Created
February 9, 2011 05:18
-
-
Save benhamill/817924 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
module Example | |
def to_yaml | |
already_tested | |
end | |
end | |
class ExampleHolder | |
include Example | |
end | |
describe "Example" do | |
subject { ExampleHolder.new } | |
it "should write to a given file" do | |
subject.should_receive(:already_tested).and_return({ 'foo' => 'bar', 'baz' => 'bom' }) | |
subject.to_yaml | |
end | |
end | |
# $ spec spec/example_spec.rb | |
# F | |
# | |
# Failures: | |
# | |
# 1) Example should write to a given file | |
# Failure/Error: already_tested | |
# NoMethodError: | |
# undefined method `already_tested' for #<ExampleHolder:0x9128c80> | |
# # ./spec/example_spec.rb:3:in `to_yaml' | |
# # ./spec/example_spec.rb:16:in `block (2 levels) in <top (required)>' | |
# | |
# Finished in 0.00098 seconds | |
# 1 example, 1 failure |
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 Example | |
def needs_testing | |
already_tested | |
end | |
end | |
class ExampleHolder | |
include Example | |
end | |
describe "Example" do | |
subject { ExampleHolder.new } | |
it "should write to a given file" do | |
subject.should_receive(:already_tested).and_return({ 'foo' => 'bar', 'baz' => 'bom' }) | |
subject.needs_testing | |
end | |
end | |
# $ spec spec/example_spec.rb | |
# . | |
# | |
# Finished in 0.00075 seconds | |
# 1 example, 0 failures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Of relevance:
$ alias spec
alias spec='bundle exec rspec --color'
It turns out
bundle exec
has something to do with it. Investigating further and will post more here when I find it out.