summaryrefslogtreecommitdiffstats
path: root/spec/unit/network
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-05-03 14:53:03 -0700
committerJacob Helwig <jacob@puppetlabs.com>2011-05-03 15:24:06 -0700
commit5569fad994978224dd24df9974ed731a409d11de (patch)
treeebbc45317aea603dd9f587955b7c2ac60e7bd253 /spec/unit/network
parentb17b49c97380cd64e75ac5e2ef12fb939ae953bb (diff)
downloadpuppet-5569fad994978224dd24df9974ed731a409d11de.tar.gz
puppet-5569fad994978224dd24df9974ed731a409d11de.tar.xz
puppet-5569fad994978224dd24df9974ed731a409d11de.zip
(#7117) Return the environment as a Puppet::Node::Environment in uri2indirection
The environment returned by uri2indirection used to be a Puppet::Node::Environment. When this changed to simply being the string of the environment name, this broke assumptions made in other areas of the code. Paired-with: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'spec/unit/network')
-rwxr-xr-xspec/unit/network/http/api/v1_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/unit/network/http/api/v1_spec.rb b/spec/unit/network/http/api/v1_spec.rb
index bd95071c1..a952f24e2 100755
--- a/spec/unit/network/http/api/v1_spec.rb
+++ b/spec/unit/network/http/api/v1_spec.rb
@@ -31,7 +31,7 @@ describe Puppet::Network::HTTP::API::V1 do
end
it "should use the first field of the URI as the environment" do
- @tester.uri2indirection("GET", "/env/foo/bar", {})[3][:environment].should == "env"
+ @tester.uri2indirection("GET", "/env/foo/bar", {})[3][:environment].to_s.should == "env"
end
it "should fail if the environment is not alphanumeric" do
@@ -39,7 +39,11 @@ describe Puppet::Network::HTTP::API::V1 do
end
it "should use the environment from the URI even if one is specified in the parameters" do
- @tester.uri2indirection("GET", "/env/foo/bar", {:environment => "otherenv"})[3][:environment].should == "env"
+ @tester.uri2indirection("GET", "/env/foo/bar", {:environment => "otherenv"})[3][:environment].to_s.should == "env"
+ end
+
+ it "should return the environment as a Puppet::Node::Environment" do
+ @tester.uri2indirection("GET", "/env/foo/bar", {})[3][:environment].should be_a Puppet::Node::Environment
end
it "should use the second field of the URI as the indirection name" do