Upgraded Rails and RSpec
[monkeycharger.git] / vendor / plugins / rspec / rspec_on_rails / spec / rails / dsl / configuration_spec.rb
blob12ec090311b5c6de6ecd8241b5dba40746917ca6
1 require File.dirname(__FILE__) + '/../../spec_helper'
3 module Spec
4   module Example
5     describe Configuration, :shared => true do
6       before(:each) { @config = Configuration.new }
7     end
9     describe Configuration, "#use_transactional_fixtures" do
10       it_should_behave_like "Spec::Example::Configuration"
11       
12       it "should default to true" do
13         @config.use_transactional_fixtures.should be(true)
14       end
16       it "should set to false" do
17         @config.use_transactional_fixtures = false
18         @config.use_transactional_fixtures.should be(false)
19       end
21       it "should set to true" do
22         @config.use_transactional_fixtures = true
23         @config.use_transactional_fixtures.should be(true)
24       end
25     end
27     describe Configuration, "#use_instantiated_fixtures" do
28       it_should_behave_like "Spec::Example::Configuration"
29       
30       it "should to false" do
31         @config.use_instantiated_fixtures.should be(false)
32       end
34       it "should set to false" do
35         @config.use_instantiated_fixtures = false
36         @config.use_instantiated_fixtures.should be(false)
37       end
39       it "should set to true" do
40         @config.use_instantiated_fixtures = true
41         @config.use_instantiated_fixtures.should be(true)
42       end
43     end
45     describe Configuration, "#fixture_path" do
46       it_should_behave_like "Spec::Example::Configuration"
47       
48       it "should default to RAILS_ROOT + '/spec/fixtures'" do
49         @config.fixture_path.should == RAILS_ROOT + '/spec/fixtures'
50         Test::Unit::TestCase.fixture_path.should == RAILS_ROOT + '/spec/fixtures'
51       end
53       it "should set fixture_path" do
54         @config.fixture_path = "/new/path"
55         @config.fixture_path.should == "/new/path"
56         Test::Unit::TestCase.fixture_path.should == "/new/path"
57       end
58     end
60     describe Configuration, "#global_fixtures" do
61       it_should_behave_like "Spec::Example::Configuration"
63       it "should default to []" do
64         @config.global_fixtures.should == []
65       end
67       it "should set to false" do
68         @config.global_fixtures << :blah
69         @config.global_fixtures.should == [:blah]
70       end
71     end
72   end
73 end