Sha256: 49d5f33744a464d115352d0d755965ecf4cc4e2878a3f5b9a7051667797c0965

Contents?: true

Size: 736 Bytes

Versions: 202

Compression:

Stored size: 736 Bytes

Contents

require "spec_helper"

describe Chef::Knife::TagDelete do
  before(:each) do
    Chef::Config[:node_name] = "webmonkey.example.com"
    @knife = Chef::Knife::TagDelete.new
    @knife.name_args = [ Chef::Config[:node_name], "sadtag" ]

    @node = Chef::Node.new
    allow(@node).to receive :save
    @node.tags << "sadtag" << "happytag"
    allow(Chef::Node).to receive(:load).and_return @node
    @stderr = StringIO.new
    allow(@knife.ui).to receive(:stderr).and_return(@stderr)
  end

  describe "run" do
    it "can delete tags on a node" do
      expect(@node.tags).to eq(%w{sadtag happytag})
      @knife.run
      expect(@node.tags).to eq(["happytag"])
      expect(@stderr.string).to match /deleted.+sadtag/i
    end
  end
end

Version data entries

202 entries across 202 versions & 1 rubygems

Version Path
chef-16.1.16 spec/unit/knife/tag_delete_spec.rb
chef-16.1.16-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-15.11.3 spec/unit/knife/tag_delete_spec.rb
chef-15.11.3-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-16.1.0 spec/unit/knife/tag_delete_spec.rb
chef-16.1.0-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-16.0.287 spec/unit/knife/tag_delete_spec.rb
chef-16.0.287-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-16.0.275 spec/unit/knife/tag_delete_spec.rb
chef-16.0.275-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-16.0.257 spec/unit/knife/tag_delete_spec.rb
chef-16.0.257-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-15.10.12-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-15.10.12 spec/unit/knife/tag_delete_spec.rb
chef-14.15.6 spec/unit/knife/tag_delete_spec.rb
chef-14.15.6-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-15.9.17 spec/unit/knife/tag_delete_spec.rb
chef-15.9.17-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-15.8.23 spec/unit/knife/tag_delete_spec.rb
chef-15.8.23-universal-mingw32 spec/unit/knife/tag_delete_spec.rb