Created
April 17, 2012 03:06
-
-
Save dpick/2403108 to your computer and use it in GitHub Desktop.
This file contains 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 'rspec' | |
class Foo | |
def initialize(list); @list = list; end | |
def method_missing(*args) | |
@list << args.first | |
end | |
end | |
describe Foo do | |
before :all do | |
$methods = [] | |
end | |
before :each do | |
@subject = Foo.new($methods) | |
end | |
it 'adds to the method listt' do | |
@subject.bar | |
end | |
it 'adds to the method list again' do | |
@subject.hi | |
end | |
it 'has 2 methods in the list' do | |
$methods.should == [:bar, :hi] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment