Created
August 30, 2012 16:31
-
-
Save kwstannard/3532475 to your computer and use it in GitHub Desktop.
Testing modules
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
module Foo | |
def bar | |
"A cow" | |
end | |
end | |
describe Foo | |
let :subject_class { Class.new } | |
let :subject { subject_class.new } | |
before :each do | |
subject_class.class_eval { include Foo } | |
end | |
it "returns a cow" do | |
subject.bar.should eq "A cow" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also use: