Skip to content

Instantly share code, notes, and snippets.

@altherlex
Created May 4, 2015 18:24
Show Gist options
  • Save altherlex/ab254bca1f4e9e6645a9 to your computer and use it in GitHub Desktop.
Save altherlex/ab254bca1f4e9e6645a9 to your computer and use it in GitHub Desktop.
subject, specify, let
#http://stackoverflow.com/questions/9778657/why-does-this-simple-rspec-string-equality-spec-fail
describe First do
specify { First.new.to_s.should == "Hello World" }
end
describe First do
describe "#to_s" do
subject { First.new.to_s }
it { should == "Hello World" }
end
end
describe First do
describe "#to_s" do
let(:result) { First.new.to_s }
specify { result.should == "Hello World" }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment