rails-4-1-rspec-3-0 icon indicating copy to clipboard operation
rails-4-1-rspec-3-0 copied to clipboard

Ch.5 be_true should be be_truthy

Open JunichiIto opened this issue 10 years ago • 0 comments

In chapter 5 Testing non-CRUD methods, the test code uses "be_true" but it should be "be_truthy" since RSpec 3.0. At least, RSpec 3.2 will fail like this:

    example do
      expect(true).to be_true
    end

  4) Sample test true should be true
     Failure/Error: expect(true).to be_true
       expected true to respond to `true?`
     # ./test_spec.rb:46:in `block (3 levels) in <top (required)>'

JunichiIto avatar Jun 16 '15 07:06 JunichiIto