Created
October 9, 2009 04:01
-
-
Save Sutto/205694 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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