spec/unit/berkshelf/vagrant/config_spec.rb in vagrant-berkshelf-2.0.1 vs spec/unit/berkshelf/vagrant/config_spec.rb in vagrant-berkshelf-3.0.0.rc1
- old
+ new
@@ -1,10 +1,10 @@
require 'spec_helper'
describe Berkshelf::Vagrant::Config do
let(:unset_value) { described_class::UNSET_VALUE }
- let(:config) { described_class.new }
+ subject { described_class.new.tap {|s| s.finalize! } }
it "sets a path to a Berksfile in the current working directory for berksfile_path" do
subject.berksfile_path.should eql(File.join(Dir.pwd, "Berksfile"))
end
@@ -12,21 +12,21 @@
before do
File.should_receive(:exist?).with(File.join(Dir.pwd, "Berksfile")).and_return(true)
end
it "it sets the value of enabled to true" do
- config.enabled.should be true
+ subject.enabled.should be true
end
end
context "when the Berksfile doesn't exist" do
before do
File.should_receive(:exist?).with(File.join(Dir.pwd, "Berksfile")).and_return(false)
end
it "set the value of enabled to false" do
- config.enabled.should be false
+ subject.enabled.should be false
end
end
it "sets the value of only to an empty array" do
subject.only.should be_a(Array)
@@ -36,15 +36,15 @@
it "sets the value of except to an empty array" do
subject.except.should be_a(Array)
subject.except.should be_empty
end
- it "sets the value of node_name to the value in the Berkshelf::Config.instance" do
- subject.node_name.should eql(Berkshelf::Config.instance.chef.node_name)
+ it "sets the value of node_name to the value in the Berkshelf::Vagrant::BerksConfig.instance" do
+ subject.node_name.should eql(Berkshelf::Vagrant::BerksConfig.instance.chef.node_name)
end
- it "sets the value of client_key to the value in Berkshelf::Config.instance" do
- subject.client_key.should eql(Berkshelf::Config.instance.chef.client_key)
+ it "sets the value of client_key to the value in Berkshelf::Vagrant::BerksConfig.instance" do
+ subject.client_key.should eql(Berkshelf::Vagrant::BerksConfig.instance.chef.client_key)
end
describe "#validate" do
let(:env) { double('env', root_path: Dir.pwd ) }
let(:config) { double('config', berkshelf: subject) }