> You normally want to use .should be_true (and .should be_false).

Right, I just changed things back but now get this error:

undefined local variable or method `be_true' for #<Class:0x2a2d710>
(NameError)


Now, if I do it with .should == true, I have verified that the problem is
that this test is failing:

user.authorize('user_sessions', 'create')[:success].should be_true

Many pass before it. But the only way I got to this is trial and error and
going line by line until it failed. Which really really sucks.

What I do not understand is why the whole rake task / test suite is failing
(seems to be crashing) when this line fails. I am used to getting:

...............................

Finished in 1.92 seconds
31 examples, 1 failures
DKMac:wavelineup3 DK$


Instead of this vomit:

DKMac:wavelineup3 DK$ rake spec
...
/Users/DK/Documents/ror/projects/wavelineup3/spec/models/user_spec.rb:14:in
`block (2 levels) in <top (required)>': undefined local variable or method
`be_true' for #<Class:0x2ae0130> (NameError)
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/example_group.rb:130:in
`module_eval'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/example_group.rb:130:in
`subclass'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/example_group.rb:117:in
`describe'
    from
/Users/DK/Documents/ror/projects/wavelineup3/spec/models/user_spec.rb:12:in
`block in <top (required)>'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/example_group.rb:130:in
`module_eval'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/example_group.rb:130:in
`subclass'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/example_group.rb:117:in
`describe'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/extensions/object.rb:7:in
`describe'
    from
/Users/DK/Documents/ror/projects/wavelineup3/spec/models/user_spec.rb:3:in
`<top (required)>'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:235:in
`load'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:235:in
`block in load'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:227:in
`load_dependency'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:235:in
`load'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/configuration.rb:308:in
`block in load_spec_files'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/configuration.rb:308:in
`map'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/configuration.rb:308:in
`load_spec_files'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/command_line.rb:18:in
`run'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/runner.rb:36:in
`run_in_process'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/runner.rb:27:in
`run'
    from 
/Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/gems/rspec-core-2.0.0.beta.22/bin/rspec:3:in
`<top (required)>'
    from /Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/bin/rspec:19:in
`load'
    from /Users/DK/.rvm/gems/ruby-1.9.2...@wavelineup3/bin/rspec:19:in
`<main>'
rake aborted!
Command failed with status (1):
[/Users/DK/.rvm/rubies/ruby-1.9.2-p0/bin/ru...]

(See full trace by running task with --trace)
DKMac:wavelineup3 DK$





On Tue, Oct 5, 2010 at 3:38 PM, Marnen Laibow-Koser <[email protected]>wrote:

> David Kahn wrote:
> > I have a function that returns the true / false Ruby type. For some
> > reason I
> > cant get rspec to swallow this.
> >
> > This errors out:
> > user.authorize.should == true
> [...]
>
> You normally want to use .should be_true (and .should be_false).
>
> Best,
> --
> Marnen Laibow-Koser
> http://www.marnen.org
> [email protected]
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to