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
expect(1<2).to be true | |
#what is really happening here is this: | |
expect(1<2).to(be(true)) |
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
#We expect a thing that we set to match an outcome | |
expect(something).to matcher(outcome) | |
#We expect a thing that we set not to match an outcome | |
expect(something).not_to matcher(outcome) |
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
require 'cat' | |
describe Cat do | |
it "is initialized with a name" do | |
cat = Cat.new("Wednesday") | |
expect(cat.name).to eq("Wednesday") | |
end | |
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
require "cat" | |
Rspec.describe("Cat"){ #examples } |
NewerOlder