summaryrefslogtreecommitdiff
path: root/spec/unit/application_spec.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-10-16 10:45:05 -0700
committerdanielsdeleo <dan@opscode.com>2013-10-16 13:53:37 -0700
commit2b1d59d0655b250d2927a061185beb8d897f3b70 (patch)
tree3d9fa37b4a8be9f57cc4d3756e339b912a571f91 /spec/unit/application_spec.rb
parenta2e417039fd2850a4bc722c2ec2db9c9c36fca73 (diff)
downloadchef-2b1d59d0655b250d2927a061185beb8d897f3b70.tar.gz
Fixup specs to handle config jail feature
Diffstat (limited to 'spec/unit/application_spec.rb')
-rw-r--r--spec/unit/application_spec.rb39
1 files changed, 7 insertions, 32 deletions
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index 3a8f9c1cde..1606c82531 100644
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -99,9 +99,15 @@ describe Chef::Application do
let(:config_content) { "rspec_ran('true')" }
let(:config_location) { "/etc/chef/default.rb" }
+ let(:config_location_pathname) do
+ p = Pathname.new(config_location)
+ p.stub(:realpath).and_return(config_location)
+ p
+ end
+
before do
@app.config[:config_file] = config_location
- File.stub(:exist?).with(config_location).and_return(true)
+ Pathname.stub(:new).with(config_location).and_return(config_location_pathname)
File.should_receive(:read).
with(config_location).
and_return(config_content)
@@ -140,37 +146,6 @@ describe Chef::Application do
Chef::Config.should_receive(:merge!)
@app.configure_chef
end
-
-<<<<<<< HEAD
- describe "when the config_file is an URL" do
- before do
- @app.config[:config_file] = "http://example.com/foo.rb"
-
- @config_file = Tempfile.new("rspec-chef-config")
- @config_file.puts("rspec_ran('true')")
- @config_file.close
-
-
- @cf = mock("cf")
- #@cf.stub!(:path).and_return("/tmp/some/path")
- #@cf.stub!(:nil?).and_return(false)
- @rest = mock("rest")
- #@rest.stub!(:get_rest).and_return(@rest)
- #@rest.stub!(:open).and_yield(@cf)
- Chef::REST.stub!(:new).and_return(@rest)
- end
-
- after {@config_file.unlink}
-
- it "should configure chef::config from an URL" do
- Chef::Application.should_receive(:config_file_exists?).with('http://example.com/foo.rb').and_call_original
- Chef::REST.should_receive(:new).with("", nil, nil).at_least(1).times.and_return(@rest)
- @rest.should_receive(:fetch).with("http://example.com/foo.rb").and_yield(@config_file)
- @app.configure_chef
- Chef::Config.rspec_ran.should == "true"
- end
-=======
->>>>>>> Load client/solo config via ConfigFetcher
end
end