Sha256: 9dec6d06261d3bc0034d8329e273ee3f993ca1788ddd2dd1a36c3334aa637cc2

Contents?: true

Size: 679 Bytes

Versions: 35

Compression:

Stored size: 679 Bytes

Contents

require 'spec_helper'

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

    @node = Chef::Node.new
    allow(@node).to receive :save
    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 create tags on a node" do
      @knife.run
      expect(@node.tags).to eq(["happytag"])
      expect(@stderr.string).to match /created tags happytag.+node webmonkey.example.com/i
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
chef-12.3.0.rc.0 spec/unit/knife/tag_create_spec.rb
chef-12.2.1-x86-mingw32 spec/unit/knife/tag_create_spec.rb
chef-12.2.1 spec/unit/knife/tag_create_spec.rb
chef-12.2.0.rc.2-x86-mingw32 spec/unit/knife/tag_create_spec.rb
chef-12.2.0.rc.2 spec/unit/knife/tag_create_spec.rb
chef-12.2.0.rc.1-x86-mingw32 spec/unit/knife/tag_create_spec.rb
chef-12.2.0.rc.1 spec/unit/knife/tag_create_spec.rb
chef-12.1.2 spec/unit/knife/tag_create_spec.rb
chef-12.1.2-x86-mingw32 spec/unit/knife/tag_create_spec.rb
chef-12.1.1-x86-mingw32 spec/unit/knife/tag_create_spec.rb
chef-12.1.1 spec/unit/knife/tag_create_spec.rb
chef-12.1.0-x86-mingw32 spec/unit/knife/tag_create_spec.rb
chef-12.1.0 spec/unit/knife/tag_create_spec.rb
chef-12.1.0.rc.0-x86-mingw32 spec/unit/knife/tag_create_spec.rb
chef-12.1.0.rc.0 spec/unit/knife/tag_create_spec.rb