Upgraded Rails and RSpec
[monkeycharger.git] / vendor / plugins / rspec / spec / spec / dsl / configuration_spec.rb
blob06ef8a753d7ae8ce833e38be97439c6a8f3daf4f
1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
3 module Spec
4   module DSL
5     describe Configuration do
6       before(:each) do
7         @config = Configuration.new
8         @behaviour = mock("behaviour")
9       end
11       it "should default mock framework to rspec" do
12         @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/rspec$/
13       end
15       it "should let you set rspec mocking explicitly" do
16         @config.mock_with(:rspec)
17         @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/rspec$/
18       end
20       it "should let you set mocha" do
21         @config.mock_with(:mocha)
22         @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/mocha$/
23       end
25       it "should let you set flexmock" do
26         @config.mock_with(:flexmock)
27         @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/flexmock$/
28       end
29       
30       it "should let you set an arbitrary adapter module" do
31         adapter = Module.new
32         @config.mock_with(adapter)
33         @config.mock_framework.should == adapter
34       end
35       
36       it "should let you define modules to be included" do
37         mod = Module.new
38         @config.include mod
39         @config.included_modules.should include(mod)
40       end
41       
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)
46         end
47       end
48     end
49   end
50 end