Given this class:
class First
def to_s ; "Hello World" ; end
end
and this spec:
require 'first'
describe First do
describe "#to_s" do
it { should == "Hello World" }
end
end
I get:
Failures:
1) First#to_s
Failure/Error: it { should == "Hello World" }
expected: "Hello World"
got: Hello World (using ==)
Diff:
@@ -1,2 +1,2 @@
-"Hello World"
+Hello World
# ./spec/first_spec.rb:5:in `block (3 levels) in <top (required)>'
But I would expect this to pass. My questions are:
- How would a passing spec look like?
- Why is this spec not passing, specifically?