Hey, I'm using TDD with rails for the first time... interesting concepts. Definitely useful. That is, until I come to this. When I run my test I get:
1) User should build the full name correctly
Failure/Error: @u1.fullname.to_s.should be("#{@attr[:firstname]} #{@attr[:lastname]}")
expected Joe Smith, got "Joe Smith"
# ./spec/models/user_spec.rb:35:in `block (2 levels) in <top (required)>'
# /home/brian/.rvm/gems/ruby-1.9.2-p0@seniorproject/gems/rspec-core-2.0.0.beta.18/lib/rspec/monkey/spork/test_framework/rspec.rb:4:in `run_tests'
# /home/brian/.rvm/gems/ruby-1.9.2-p0@seniorproject/gems/spork-0.8.4/lib/spork/run_strategy/forking.rb:13:in `block in run'
# /home/brian/.rvm/gems/ruby-1.9.2-p0@seniorproject/gems/spork-0.8.4/lib/spork/forker.rb:21:in `block in initialize'
# /home/brian/.rvm/gems/ruby-1.9.2-p0@seniorproject/gems/spork-0.8.4/lib/spork/forker.rb:18:in `fork'
# /home/brian/.rvm/gems/ruby-1.9.2-p0@seniorproject/gems/spork-0.8.4/lib/spork/forker.rb:18:in `initialize'
# /home/brian/.rvm/gems/ruby-1.9.2-p0@seniorproject/gems/spork-0.8.4/lib/spork/run_strategy/forking.rb:9:in `new'
# /home/brian/.rvm/gems/ruby-1.9.2-p0@seniorproject/gems/spork-0.8.4/lib/spork/run_strategy/forking.rb:9:in `run'
# /home/brian/.rvm/gems/ruby-1.9.2-p0@seniorproject/gems/spork-0.8.4/lib/spork/server.rb:47:in `run'
where the test is:
it 'should build the full name correctly' do
@u1.fullname.should be("#{@attr[:firstname]} #{@attr[:lastname]}")
end
and the supporting code is:
def fullname
"#{firstname} #{lastname}"
end
So obviously this works, but what's with the quotation marks? Have I missed something head-smackingly obvious?