lib/bogus/rspec_extensions.rb in bogus-0.0.2 vs lib/bogus/rspec_extensions.rb in bogus-0.0.3.rc.1

- old
+ new

@@ -1,36 +1,24 @@ module Bogus module RSpecExtensions def fake(name, opts = {}, &block) - let(name) { Bogus.fake_for(name, opts, &block) } + let(name) { fake(name, opts, &block) } end + def fake_class(name, opts = {}) + before do + fake_class(name, opts) + end + end + def verify_contract(name) before do - Bogus.record_calls_for(name) + Bogus.record_calls_for(name, described_class) end RSpec.configure do |config| config.after(:suite) { Bogus.verify_contract!(name) } end - end - end - - module MockingDSL - def fake(*args) - Bogus.create_anonymous_stub(*args) - end - - def stub(*args) - Bogus.create_stub(*args) - end - - def have_received(*args) - Bogus.have_received(*args) - end - - def mock(*args) - Bogus.create_mock(*args) end end end