summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-02-14 17:50:19 -0600
committerLuke Kanies <luke@madstop.com>2009-02-18 22:38:43 -0600
commit5fd182dc1ce1e5e8dd0eba83d7514e9950aca8a0 (patch)
tree3b65b5796d2a9cf6967ba9f0e5148c313bed3dc1 /spec
parent7bc41cefa0115067a2e9aab3dbd1924667c46dfe (diff)
downloadpuppet-5fd182dc1ce1e5e8dd0eba83d7514e9950aca8a0.tar.gz
puppet-5fd182dc1ce1e5e8dd0eba83d7514e9950aca8a0.tar.xz
puppet-5fd182dc1ce1e5e8dd0eba83d7514e9950aca8a0.zip
Fixing fileserving to support strings or symbols
When used internally we would use symbols, but the REST transfers need to support strings. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/integration/indirector/rest.rb8
-rwxr-xr-xspec/unit/file_serving/base.rb4
2 files changed, 8 insertions, 4 deletions
diff --git a/spec/integration/indirector/rest.rb b/spec/integration/indirector/rest.rb
index 1adbdac61..cfaaa5027 100755
--- a/spec/integration/indirector/rest.rb
+++ b/spec/integration/indirector/rest.rb
@@ -94,7 +94,7 @@ describe Puppet::Indirector::REST do
end
it "should pass options all the way through" do
- @mock_model.expects(:find).with { |key, args| args["one"] == "two" and args["three"] == "four" }.returns @model_instance
+ @mock_model.expects(:find).with { |key, args| args[:one] == "two" and args[:three] == "four" }.returns @model_instance
Puppet::TestIndirectedFoo.find('bar', :one => "two", :three => "four")
end
@@ -159,7 +159,7 @@ describe Puppet::Indirector::REST do
end
it "should pass options all the way through" do
- @mock_model.expects(:search).with { |key, args| args["one"] == "two" and args["three"] == "four" }.returns @model_instances
+ @mock_model.expects(:search).with { |key, args| args[:one] == "two" and args[:three] == "four" }.returns @model_instances
Puppet::TestIndirectedFoo.search("foo", :one => "two", :three => "four")
end
@@ -328,7 +328,7 @@ describe Puppet::Indirector::REST do
end
it "should pass options all the way through" do
- @mock_model.expects(:find).with { |key, args| args["one"] == "two" and args["three"] == "four" }.returns @model_instance
+ @mock_model.expects(:find).with { |key, args| args[:one] == "two" and args[:three] == "four" }.returns @model_instance
Puppet::TestIndirectedFoo.find('bar', :one => "two", :three => "four")
end
@@ -390,7 +390,7 @@ describe Puppet::Indirector::REST do
end
it "should pass options all the way through" do
- @mock_model.expects(:search).with { |key, args| args["one"] == "two" and args["three"] == "four" }.returns @model_instances
+ @mock_model.expects(:search).with { |key, args| args[:one] == "two" and args[:three] == "four" }.returns @model_instances
Puppet::TestIndirectedFoo.search('bar', :one => "two", :three => "four")
end
diff --git a/spec/unit/file_serving/base.rb b/spec/unit/file_serving/base.rb
index 4eb62b038..de7ea4756 100755
--- a/spec/unit/file_serving/base.rb
+++ b/spec/unit/file_serving/base.rb
@@ -31,6 +31,10 @@ describe Puppet::FileServing::Base do
proc { Puppet::FileServing::Base.new("/module/dir/file", :links => :else) }.should raise_error(ArgumentError)
end
+ it "should allow links values to be set as strings" do
+ Puppet::FileServing::Base.new("/module/dir/file", :links => "follow").links.should == :follow
+ end
+
it "should default to :manage for :links" do
Puppet::FileServing::Base.new("/module/dir/file").links.should == :manage
end