From df8d766407ac33d765fc3e2c969b217d5c6242ad Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 9 Feb 2017 17:58:24 +0000 Subject: Remove Ruby 1.8/1.9 code from the specs Signed-off-by: Tim Smith --- spec/integration/knife/chef_fs_data_store_spec.rb | 6 +++--- spec/integration/knife/diff_spec.rb | 12 ++++++------ spec/integration/knife/raw_spec.rb | 10 +++++----- spec/integration/knife/show_spec.rb | 6 +++--- spec/support/chef_helpers.rb | 20 -------------------- 5 files changed, 17 insertions(+), 37 deletions(-) diff --git a/spec/integration/knife/chef_fs_data_store_spec.rb b/spec/integration/knife/chef_fs_data_store_spec.rb index 02508b799d..9c3cd9a246 100644 --- a/spec/integration/knife/chef_fs_data_store_spec.rb +++ b/spec/integration/knife/chef_fs_data_store_spec.rb @@ -218,7 +218,7 @@ EOM knife("list --local /roles").should_succeed "/roles/x.json\n" end - it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty", :skip => (RUBY_VERSION < "1.9") do + it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty" do knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed( /"x"/ ) expect(IO.read(path_to("roles/x.json"))).to eq < (RUBY_VERSION < "1.9") do + it "After knife raw -z -i rolestuff.json -m POST /roles, the output is pretty" do knife("raw -z -i #{path_to('rolestuff.json')} -m POST /roles").should_succeed( /uri/ ) expect(IO.read(path_to("roles/x.json"))).to eq < (RUBY_VERSION < "1.9") do + it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty" do knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed( /"x"/ ) expect(IO.read(path_to("roles/x.json"))).to eq < "hi" } } - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference" do knife("diff /environments/x.json").should_succeed(/ { - "name": "x", @@ -277,7 +277,7 @@ EOM environment "x", {} end - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference" do knife("diff /environments/x.json").should_succeed(/ { - "name": "x" @@ -291,7 +291,7 @@ EOM before do environment "x", { "description" => "lo" } end - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference" do knife("diff /environments/x.json").should_succeed(/ { "name": "x", @@ -533,7 +533,7 @@ EOM end when_the_chef_server "has an environment with a different value" do before { environment "x", { "description" => "hi" } } - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference" do knife("diff /environments/x.json").should_succeed(/ { - "name": "x", @@ -560,7 +560,7 @@ EOM end when_the_chef_server "has an environment with no value" do before { environment "x", {} } - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference" do knife("diff /environments/x.json").should_succeed(/ { - "name": "x" @@ -574,7 +574,7 @@ EOM before do environment "x", { "description" => "lo" } end - it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do + it "knife diff reports the difference" do knife("diff /environments/x.json").should_succeed(/ { "name": "x", diff --git a/spec/integration/knife/raw_spec.rb b/spec/integration/knife/raw_spec.rb index 5e0d3a3d11..043ed55eb9 100644 --- a/spec/integration/knife/raw_spec.rb +++ b/spec/integration/knife/raw_spec.rb @@ -38,7 +38,7 @@ describe "knife raw", :workstation do user "x", "{}" end - it "knife raw /nodes/x returns the node", :skip => (RUBY_VERSION < "1.9") do + it "knife raw /nodes/x returns the node" do knife("raw /nodes/x").should_succeed < (RUBY_VERSION < "1.9") do + it "knife raw -m DELETE /roles/x succeeds" do knife("raw -m DELETE /roles/x").should_succeed < (RUBY_VERSION < "1.9") do + it "knife raw -m PUT -i blah.txt /roles/x succeeds" do Tempfile.open("raw_put_input") do |file| file.write < (RUBY_VERSION < "1.9") do + it "knife raw -m POST -i blah.txt /roles succeeds" do Tempfile.open("raw_put_input") do |file| file.write < (RUBY_VERSION < "1.9") do + it "knife raw /blah returns the prettified json" do knife("raw /blah").should_succeed < (RUBY_VERSION < "1.9") do + it "knife show /environments/x.json shows the remote version" do knife("show /environments/x.json").should_succeed < (RUBY_VERSION < "1.9") do + it "knife show /roles/x.json shows the remote version" do knife("show /roles/x.json").should_succeed < "x", } end - it "knife show shows the attributes in a predetermined order", :skip => (RUBY_VERSION < "1.9") do + it "knife show shows the attributes in a predetermined order" do knife("show /environments/x.json").should_succeed <