Created
November 10, 2008 02:12
-
-
Save dchelimsky/23406 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 'rubygems' | |
require 'spec' | |
require 'spec/mocks' | |
require "synthesis/util/mock_instance/rspec" | |
class Person; end | |
describe "synthesis" do | |
it "accepts a greeting (non-existent method)" do | |
person = Person.new | |
person.should_receive(:hello) | |
person.hello | |
end | |
it "accepts a greeting (method defined at runtime)" do | |
person = Person.new | |
greetings = Module.new do | |
def hello; "hello"; end | |
end | |
person.extend greetings | |
person.hello.should == "hello" | |
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
require 'rubygems' | |
require 'synthesis/task' | |
Synthesis::Task.new do |t| | |
t.adapter = :rspec | |
t.pattern = '**/*.rb' | |
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
$ rake synthesis:test | |
(in /Users/david/projects/ruby/tmp/synth) | |
[Synthesis] Collecting expectations... | |
.. | |
Finished in 0.003435 seconds | |
2 examples, 0 failures | |
[Synthesis] Verifying expectation invocations... | |
.. | |
Finished in 0.001284 seconds | |
2 examples, 0 failures | |
[Synthesis] | |
[Synthesis] Tested Expectations: | |
[Synthesis] | |
[Synthesis] Untested Expectations: | |
() Person.new.hello() in ./example.rb:11 | |
[Synthesis] Ignoring: | |
[Synthesis] | |
[Synthesis] FAILED. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment