Sha256: 753b2b4be4122290e1b34652a0dcb288f0d365058f0a196a5c2df1266d826d43

Contents?: true

Size: 686 Bytes

Versions: 14

Compression:

Stored size: 686 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
    @node.stub :save
    @node.tags << "sadtag" << "happytag"
    Chef::Node.stub(:load).and_return @node
    @stderr = StringIO.new
    @knife.ui.stub(:stderr).and_return(@stderr)
  end

  describe "run" do
    it "can delete tags on a node" do
      @node.tags.should == ["sadtag", "happytag"]
      @knife.run
      @node.tags.should == ["happytag"]
      @stderr.string.should match /deleted.+sadtag/i
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
chef-12.0.3-x86-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.0.3 spec/unit/knife/tag_delete_spec.rb
chef-12.0.1-x86-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.0.1 spec/unit/knife/tag_delete_spec.rb
chef-12.0.0-x86-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.0.0 spec/unit/knife/tag_delete_spec.rb
chef-12.0.0.rc.0-x86-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.0.0.rc.0 spec/unit/knife/tag_delete_spec.rb
chef-12.0.0.alpha.2-x86-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.0.0.alpha.2 spec/unit/knife/tag_delete_spec.rb
chef-12.0.0.alpha.1-x86-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.0.0.alpha.1 spec/unit/knife/tag_delete_spec.rb
chef-12.0.0.alpha.0-x86-mingw32 spec/unit/knife/tag_delete_spec.rb
chef-12.0.0.alpha.0 spec/unit/knife/tag_delete_spec.rb