Permalink
Browse files

get the specs passing again

  • Loading branch information...
1 parent 373a80b commit f88ca863130338310cbc5902ea4ed3d7216f72ea @joshk joshk committed Dec 2, 2011
Showing with 9 additions and 5 deletions.
  1. +5 −1 lib/travis/boxes/config.rb
  2. +4 −4 spec/config_spec.rb
@@ -29,7 +29,7 @@ def method_missing(name, *args, &block)
protected
def read(name)
- base.merge(read_yml(name)).merge((local['base'] || {}).merge(local[name] || {})).merge(:definition => name)
+ base.merge(active_definition(name)).merge((local['base'] || {}).merge(local[name] || {})).merge('definition' => name)
end
def base
@@ -40,6 +40,10 @@ def local
read_yml
end
+ def active_definition(name)
+ read_yml(name)
+ end
+
def read_yml(name = nil)
path = self.path(name)
File.exists?(path) ? path : raise("Could not find a configuration file #{path}")
View
@@ -8,8 +8,8 @@
Travis::Boxes::Config.any_instance.stub(:read).and_return({})
end
- it ':base defaults "lucid32_new.box"' do
- config.test.base.should == 'lucid32.box'
+ it ':base defaults "natty32_new.box"' do
+ config.test.base.should == 'natty32.box'
end
it ':cookbooks defaults to "vendor/travis-cookbooks"' do
@@ -29,7 +29,7 @@
DATA_STUBS = {
'local' => { 'base' => { 'secret' => 'secret' }, 'staging' => { 'another_secret' => 'another_secret' } },
'base' => { 'foo' => 'foo' },
- 'env' => { 'bar' => 'bar' }
+ 'active_definition' => { 'bar' => 'bar' }
}
before :each do
@@ -53,7 +53,7 @@
end
it 'adds the environment to the configuration' do
- config.staging.env.should == 'staging'
+ config.staging.definition.should == 'staging'
end
end

0 comments on commit f88ca86

Please sign in to comment.