[rspec-users] Caveman Questions - how to use mock_model in script/console?

David Chelimsky dchelimsky at gmail.com
Fri Oct 5 12:46:08 EDT 2007


On 10/5/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
>
>
> On Sep 11, 2007, at 2:37 PM, Geoffrey Wiseman wrote:
> On 9/5/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> > irb(main):001:0> require 'rubygems'
> > => true
> > irb(main):002:0> require 'spec'
> > => true
> > irb(main):003:0> include Spec::Matchers
> > => Object
> > irb(main):004:0> 5.should == 5
> > => nil
> > irb(main):005:0> 5.should be < 4
> > Spec::Expectations::ExpectationNotMetError: expected < 4,
> got 5
> >
>
> $ script/console
> Loading development environment.
> >> require 'rubygems'
> => []
> >> require 'spec'
> NameError: undefined method `failure_message' for class
> `Spec::Matchers::Have'
>         from
> /work/workspace/ng/vendor/plugins/rspec_on_rails/lib/spec/matchers/have.rb:4:in
> `alias_method'
>         from
> /work/workspace/ng/vendor/plugins/rspec_on_rails/lib/spec/matchers/have.rb:4
>         from
> /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `gem_original_require'
>
>
> David - I haven't seen a follow up to this post.  Could you guide me on the
> right direction?
>
> I see that in irb I can include Spec::Mocks::SpecMethods, which allows me
> mock 'something'.  How would I get access to mock_model?

huh? I don't see how the except you quoted relates to mock model

>
> Scott
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list