Created
December 2, 2011 15:42
-
-
Save anewusername1/1423678 to your computer and use it in GitHub Desktop.
bad rspec test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "should allow only strings that include the letter 'a'" do | |
StringAllower.allowed?('a bed').should == true | |
StringAllower.allowed?('my bed').should == false | |
StringAllower.allowed?('single bed').should == false | |
StringAllower.allowed?('a single bed').should == true | |
StringAllower.allowed?('some car').should == true | |
StringAllower.allowed?('some motorcycle').should == false | |
.... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'allowed?' do | |
['a bed', 'a single bed', 'some car'].each do |allowed_word| | |
context "with allowed word: #{allowed_word}" do | |
let(:word) { allowed_word } | |
specify { StringAllower.allowed?(word).should be_true } | |
end | |
end | |
['my bed', 'single bed', 'some motorcycle'].each do |disallowed_word| | |
context "with disallowed word: #{disallowed_word}" do | |
let(:word) { disallowed_word } | |
specify { StringAllower.allowed?(word).should be_false } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment