summaryrefslogtreecommitdiffstats
path: root/spec/unit/node_spec.rb
diff options
context:
space:
mode:
authorMax Martin <max@puppetlabs.com>2011-04-21 19:04:04 -0700
committerMax Martin <max@puppetlabs.com>2011-04-21 19:04:04 -0700
commit1e9cc2cbf984633ab7ac63d466b3e4db8bca1445 (patch)
tree41991d2994934031c7e7671544d427f1d0a09257 /spec/unit/node_spec.rb
parente185be0a6d35c84a60b940f233f87c0908547dee (diff)
parent2a2226c0b71aafcda953057d3ecc8df5638447f2 (diff)
downloadpuppet-1e9cc2cbf984633ab7ac63d466b3e4db8bca1445.tar.gz
puppet-1e9cc2cbf984633ab7ac63d466b3e4db8bca1445.tar.xz
puppet-1e9cc2cbf984633ab7ac63d466b3e4db8bca1445.zip
Merge branch 'ticket/2.7.x/7080-reverts' into 2.7.x
* ticket/2.7.x/7080-reverts: Revert "Fixing Facts pson methods more resilient" Revert "(7080) Adding json support to Indirector Request" Revert "Adding json support to Puppet::Node"
Diffstat (limited to 'spec/unit/node_spec.rb')
-rwxr-xr-xspec/unit/node_spec.rb63
1 files changed, 0 insertions, 63 deletions
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb
index e8f826dca..169a9cdcf 100755
--- a/spec/unit/node_spec.rb
+++ b/spec/unit/node_spec.rb
@@ -36,69 +36,6 @@ describe Puppet::Node do
node.environment.name.should == :bar
end
end
-
- describe "when converting to json" do
- before do
- @node = Puppet::Node.new("mynode")
- end
-
- it "should provide its name" do
- @node.should set_json_attribute('name').to("mynode")
- end
-
- it "should include the classes if set" do
- @node.classes = %w{a b c}
- @node.should set_json_attribute("classes").to(%w{a b c})
- end
-
- it "should not include the classes if there are none" do
- @node.should_not set_json_attribute('classes')
- end
-
- it "should include parameters if set" do
- @node.parameters = {"a" => "b", "c" => "d"}
- @node.should set_json_attribute('parameters').to({"a" => "b", "c" => "d"})
- end
-
- it "should not include the parameters if there are none" do
- @node.should_not set_json_attribute('parameters')
- end
-
- it "should include the environment" do
- @node.environment = "production"
- @node.should set_json_attribute('environment').to('production')
- end
- end
-
- describe "when converting from json" do
- before do
- @node = Puppet::Node.new("mynode")
- @format = Puppet::Network::FormatHandler.format('pson')
- end
-
- def from_json(json)
- @format.intern(Puppet::Node, json)
- end
-
- it "should set its name" do
- Puppet::Node.should read_json_attribute('name').from(@node.to_pson).as("mynode")
- end
-
- it "should include the classes if set" do
- @node.classes = %w{a b c}
- Puppet::Node.should read_json_attribute('classes').from(@node.to_pson).as(%w{a b c})
- end
-
- it "should include parameters if set" do
- @node.parameters = {"a" => "b", "c" => "d"}
- Puppet::Node.should read_json_attribute('parameters').from(@node.to_pson).as({"a" => "b", "c" => "d"})
- end
-
- it "should include the environment" do
- @node.environment = "production"
- Puppet::Node.should read_json_attribute('environment').from(@node.to_pson).as(Puppet::Node::Environment.new(:production))
- end
- end
end
describe Puppet::Node, "when initializing" do