diff options
Diffstat (limited to 'spec/unit/run_list/versioned_recipe_list_spec.rb')
-rw-r--r-- | spec/unit/run_list/versioned_recipe_list_spec.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/unit/run_list/versioned_recipe_list_spec.rb b/spec/unit/run_list/versioned_recipe_list_spec.rb index 5cef32c32b..209ac37fc1 100644 --- a/spec/unit/run_list/versioned_recipe_list_spec.rb +++ b/spec/unit/run_list/versioned_recipe_list_spec.rb @@ -22,7 +22,7 @@ describe Chef::RunList::VersionedRecipeList do describe "initialize" do it "should create an empty array" do l = Chef::RunList::VersionedRecipeList.new - l.should == [] + expect(l).to eq([]) end end @@ -36,41 +36,41 @@ describe Chef::RunList::VersionedRecipeList do it "should append the recipe to the end of the list" do @list.add_recipe "rails" - @list.should == ["apt", "god", "apache2", "rails"] + expect(@list).to eq(["apt", "god", "apache2", "rails"]) end it "should not duplicate entries" do @list.add_recipe "apt" - @list.should == ["apt", "god", "apache2"] + expect(@list).to eq(["apt", "god", "apache2"]) end it "should allow you to specify a version" do @list.add_recipe "rails", "1.0.0" - @list.should == ["apt", "god", "apache2", "rails"] - @list.with_versions.should include({:name => "rails", :version => "1.0.0"}) + expect(@list).to eq(["apt", "god", "apache2", "rails"]) + expect(@list.with_versions).to include({:name => "rails", :version => "1.0.0"}) end it "should allow you to specify a version for a recipe that already exists" do @list.add_recipe "apt", "1.2.3" - @list.should == ["apt", "god", "apache2"] - @list.with_versions.should include({:name => "apt", :version => "1.2.3"}) + expect(@list).to eq(["apt", "god", "apache2"]) + expect(@list.with_versions).to include({:name => "apt", :version => "1.2.3"}) end it "should allow you to specify the same version of a recipe twice" do @list.add_recipe "rails", "1.0.0" @list.add_recipe "rails", "1.0.0" - @list.with_versions.should include({:name => "rails", :version => "1.0.0"}) + expect(@list.with_versions).to include({:name => "rails", :version => "1.0.0"}) end it "should allow you to spcify no version, even when a version already exists" do @list.add_recipe "rails", "1.0.0" @list.add_recipe "rails" - @list.with_versions.should include({:name => "rails", :version => "1.0.0"}) + expect(@list.with_versions).to include({:name => "rails", :version => "1.0.0"}) end it "should not allow multiple versions of the same recipe" do @list.add_recipe "rails", "1.0.0" - lambda {@list.add_recipe "rails", "0.1.0"}.should raise_error Chef::Exceptions::CookbookVersionConflict + expect {@list.add_recipe "rails", "0.1.0"}.to raise_error Chef::Exceptions::CookbookVersionConflict end end @@ -86,13 +86,13 @@ describe Chef::RunList::VersionedRecipeList do end it "should return an array of hashes with :name and :version" do - @list.with_versions.should == @recipes + expect(@list.with_versions).to eq(@recipes) end it "should retain the same order as the version-less list" do with_versions = @list.with_versions @list.each_with_index do |item, index| - with_versions[index][:name].should == item + expect(with_versions[index][:name]).to eq(item) end end end @@ -115,8 +115,8 @@ describe Chef::RunList::VersionedRecipeList do it "should return an array of hashes with :name and :version_constraint" do @list.with_version_constraints.each do |x| - x.should have_key :name - x[:version_constraint].should_not be nil + expect(x).to have_key :name + expect(x[:version_constraint]).not_to be nil end end end |