[rspec-users] Caveman Questions - how to use mock_model in script/console?
Scott Taylor
mailing_lists at railsnewbie.com
Fri Oct 5 12:43:28 EDT 2007
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?
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071005/5b209a61/attachment.html
More information about the rspec-users
mailing list