Skip to content

Instantly share code, notes, and snippets.

@Sutto
Created October 9, 2009 04:01
Show Gist options
  • Select an option

  • Save Sutto/205694 to your computer and use it in GitHub Desktop.

Select an option

Save Sutto/205694 to your computer and use it in GitHub Desktop.
require 'test/unit'
require 'shoulda'
require 'rr'
class X
def handle(a, opts = {})
p a, opts
end
end
class RRTest < Test::Unit::TestCase
include RR::Adapters::TestUnit
context 'a simple test' do
setup do
@handler = X.new
end
should 'mock stuff correctly' do
mock(@handler).handle(:sample_event, :awesome => true, :sauce => 2)
@handler.handle(:sample_event, :awesome => true, :sauce => 2)
end
end
end
On Ruby 1.9.1 w/ RR v0.10.4, this tests fails for me - citing the mock is
never called. it works fine on Ruby 1.8 (w/ 0.10.0 and 0.10.4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment