1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
5 describe Configuration do
7 @config = Configuration.new
8 @behaviour = mock("behaviour")
11 it "should default mock framework to rspec" do
12 @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/rspec$/
15 it "should let you set rspec mocking explicitly" do
16 @config.mock_with(:rspec)
17 @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/rspec$/
20 it "should let you set mocha" do
21 @config.mock_with(:mocha)
22 @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/mocha$/
25 it "should let you set flexmock" do
26 @config.mock_with(:flexmock)
27 @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/flexmock$/
30 it "should let you set an arbitrary adapter module" do
32 @config.mock_with(adapter)
33 @config.mock_framework.should == adapter
36 it "should let you define modules to be included" do
39 @config.included_modules.should include(mod)
42 [:prepend_before, :append_before, :prepend_after, :append_after].each do |m|
43 it "should delegate ##{m} to Behaviour class" do
44 Behaviour.should_receive(m).with(:whatever)
45 @config.__send__(m, :whatever)