Displaying 8 results from an estimated 8 matches for "remove_method".
2007 Mar 12
10
using mocha with rspec
...nonymous classes, so it wasn''t quite that obvious.
Anyway, here is the incantation I ended up using in my equivalent of a
test_helper.rb file that I include in all my spec files:
# replace rspec''s mocks with mocha
require ''mocha''
module Spec
module Mocks
remove_method :mock
remove_method :stub
remove_method :verify_mocks if method_defined? :verify_mocks
include Mocha::AutoVerify
end
end
Now I have working mock(), stub() and verify_mocks(). Not sure what
other Mocha stuff I''m missing yet, but I''ll let you know how I get on.
I no...
2009 May 21
2
PuppetShow undefined methods problems..
I get these stack traces after setting up puppetshow and browsing the
gui at http://site:3000/
http://pastebin.com/m459851f6
Any ideas? Im using 0.24.5 with rails 2.0.2 on a debian 5.0.1..
/flash
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to
2007 Oct 08
0
Can''t debug specs in Netbeans
Hi. I can''t seem to get debugging of specs working in Netbeans. AFAIK, I''m
supposed to be able to just do Command+Shift+F5 with the spec open in the
editor but i get this error:
/Users/admin/src/expresso/vendor/plugins/rspec/lib/spec/test/unit/autorunner.rb:2:in
`remove_method'': method `process_args'' not defined in Test::Unit::AutoRunner
(NameError)
from
/Users/admin/src/expresso/vendor/plugins/rspec/lib/spec/test/unit/autorunner.rb:2
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require''...
2006 Aug 01
4
How do you evaluate text as code in Ruby?
How do you evaluate text as code in Ruby?
I''m sure there''s a technical term for this...
Thanks
Chris
--
Posted via http://www.ruby-forum.com/.
2008 Jan 15
0
Problem with ruby-debug and rspec
...-hmac-0.3.1
brickhouse:~/code/fireeagle-rails/core/trunk rabble$ spec
spec/controllers/account_controller_spec.rb
/Users/rabble/code/fireeagle-rails/core/trunk/lib/sso_authentication/test_helper.rb:15
@controller.stubs(:current_user).returns(user)
(rdb:1) p self
INTERNAL ERROR!!! undefined method `remove_method'' for
#<Spec::Rails::Example::ControllerExampleGroup::Subclass_1:0x34a22a4>
/Users/rabble/code/fireeagle-rails/core/trunk/vendor/rails/actionpack/lib/action_controller/test_process.rb:464:in
`method_missing''
/opt/local/lib/ruby/gems/1.8/gems/rspec-1.1.2/lib/sp...
2006 Apr 06
16
Rails Masters'' debugging techniques -> Rails Recipes?
Hi,
This msg for Chad Fowler or anyone who fits the subject line.
I bought the Recipes book and really like the way it has been
progressing. There is one subject I''d like to see explored in detail.
Having come from Assembly and C background I find that a ''must have''
tool in your collection is the debugger.
I find debugging a Rails App the most thorny issue inversely
2007 Mar 30
7
problem with using any_instance
Hey all,
I have a question with using mocha in my tests.
In the same test file, I have two tests,
<code>
def test_a
klass.any_instance.stubs(:method_name).returns("something")
klass.new.method_name
...
end
def test_b
...
klass.new.method_name
...
end
</code>
where klass is some class
when the tests run, test _a passes, but test_b had an error like this:
2011 Sep 13
12
Assertions for asynchronous behaviour
Hi all,
In GOOS[1] they use an assertion called assertEventually which samples the system for a success state until a certain timeout has elapsed. This allows you to synchronise the tests with asynchronous code.
Do we have an equivalent of that in the Ruby / RSpec world already? I know capybara has wait_until { } but that''s fairly rudimentary - the failure message isn''t very