RSpec 3 Syntax
No more ‘should’
Use only ‘expect’
(1+1).should eq 2
becomes
expect(1+1).to eq 2
be_true and be_false 

are gone
use

be_truthy and be_falsey

instead
my_obj.test.should be_true
becomes
expect(my_obj.test).to be_truthy
Use curly braces when
you want to evaluate
later.
expect{ my_obj.oops }.to raise_error
Pending examples are
now run.

They fail if they pass.
One liners are changed
it { should be_empty }
it { is_expected.to be_empty }
Chaining expectations!
expect(my_color).to eq(‘red’).or
eq(‘blue’).or eq(‘green’)
expect(alphabet).to start_with(‘a’).and
include(‘h’).and end_with(‘z’)
Simpler!
expect(my_color).to eq(‘red’) | eq(‘blue’)
| eq(‘green’)
expect(alphabet).to start_with(‘a’) &
include(‘h’) & end_with(‘z’)

null_object_meetup