Sha256: 88015f837757b673a562e54d04c8219167e6f447f59b480813511fa3c06fe00f

Contents?: true

Size: 739 Bytes

Versions: 35

Compression:

Stored size: 739 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(["sadtag", "happytag"])
      @knife.run
      expect(@node.tags).to eq(["happytag"])
      expect(@stderr.string).to match /deleted.+sadtag/i
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
chef-12.6.0 spec/unit/knife/tag_delete_spec.rb
chef-12.6.0-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.5.1-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.5.1 spec/unit/knife/tag_delete_spec.rb
chef-12.4.3-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.4.3 spec/unit/knife/tag_delete_spec.rb
chef-12.4.2-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.4.2 spec/unit/knife/tag_delete_spec.rb
chef-12.5.0.alpha.1 spec/unit/knife/tag_delete_spec.rb
chef-12.4.1-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.4.1 spec/unit/knife/tag_delete_spec.rb
chef-12.4.0 spec/unit/knife/tag_delete_spec.rb
chef-12.4.0-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.4.0.rc.2 spec/unit/knife/tag_delete_spec.rb
chef-12.4.0.rc.2-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.4.0.rc.0 spec/unit/knife/tag_delete_spec.rb
chef-12.4.0.rc.0-universal-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.3.0-x86-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.3.0 spec/unit/knife/tag_delete_spec.rb
chef-12.3.0.rc.0-x86-mingw32 spec/unit/knife/tag_delete_spec.rb