SlideShare a Scribd company logo
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’)

More Related Content

Viewers also liked

په‌راوێزه‌ ميدياييه‌كان 4 ئه‌رسه‌لان ره‌حمان
په‌راوێزه‌ ميدياييه‌كان 4 ئه‌رسه‌لان ره‌حمانپه‌راوێزه‌ ميدياييه‌كان 4 ئه‌رسه‌لان ره‌حمان
په‌راوێزه‌ ميدياييه‌كان 4 ئه‌رسه‌لان ره‌حمانArsalan Rahman
 
ActiveSupport
ActiveSupportActiveSupport
ActiveSupportsean_todd
 
Suresh Resume with Pic
Suresh Resume with PicSuresh Resume with Pic
Suresh Resume with PicSURESH BABU
 
owasp_meetup_12_10
owasp_meetup_12_10owasp_meetup_12_10
owasp_meetup_12_10sean_todd
 
Zurb foundation
Zurb foundationZurb foundation
Zurb foundationsean_todd
 
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌Arsalan Rahman
 
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌Arsalan Rahman
 
Rails Engines
Rails EnginesRails Engines
Rails Enginessean_todd
 
په‌راوێزه‌ ميدياييه‌كان 4
په‌راوێزه‌ ميدياييه‌كان 4په‌راوێزه‌ ميدياييه‌كان 4
په‌راوێزه‌ ميدياييه‌كان 4Arsalan Rahman
 
Selenium webdriver
Selenium webdriverSelenium webdriver
Selenium webdriversean_todd
 
What is teaching
What is teachingWhat is teaching
What is teachingdrarchanac
 
8. pengembangan bahan ajar
8. pengembangan bahan ajar8. pengembangan bahan ajar
8. pengembangan bahan ajarKiki Yulita Sari
 

Viewers also liked (15)

په‌راوێزه‌ ميدياييه‌كان 4 ئه‌رسه‌لان ره‌حمان
په‌راوێزه‌ ميدياييه‌كان 4 ئه‌رسه‌لان ره‌حمانپه‌راوێزه‌ ميدياييه‌كان 4 ئه‌رسه‌لان ره‌حمان
په‌راوێزه‌ ميدياييه‌كان 4 ئه‌رسه‌لان ره‌حمان
 
ActiveSupport
ActiveSupportActiveSupport
ActiveSupport
 
Suresh Resume with Pic
Suresh Resume with PicSuresh Resume with Pic
Suresh Resume with Pic
 
owasp_meetup_12_10
owasp_meetup_12_10owasp_meetup_12_10
owasp_meetup_12_10
 
Zurb foundation
Zurb foundationZurb foundation
Zurb foundation
 
Africa Rising 2014
Africa Rising 2014Africa Rising 2014
Africa Rising 2014
 
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌
 
Nrt 1 7 - 2014
Nrt 1   7 - 2014Nrt 1   7 - 2014
Nrt 1 7 - 2014
 
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌
ئه‌مجاره‌ش بارزانى پشتوێنه‌كه‌ى شل ده‌كاته‌وه‌
 
Rails Engines
Rails EnginesRails Engines
Rails Engines
 
په‌راوێزه‌ ميدياييه‌كان 4
په‌راوێزه‌ ميدياييه‌كان 4په‌راوێزه‌ ميدياييه‌كان 4
په‌راوێزه‌ ميدياييه‌كان 4
 
Selenium webdriver
Selenium webdriverSelenium webdriver
Selenium webdriver
 
What is teaching
What is teachingWhat is teaching
What is teaching
 
tipos de bombas
tipos de bombas tipos de bombas
tipos de bombas
 
8. pengembangan bahan ajar
8. pengembangan bahan ajar8. pengembangan bahan ajar
8. pengembangan bahan ajar
 

null_object_meetup