summaryrefslogtreecommitdiff
path: root/spec/unit/knife/tag_list_spec.rb
blob: 3724a5c0b77d3851a9244fc6ff38ac58ecf3f76c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'spec_helper'

describe Chef::Knife::TagList do
  before(:each) do
    Chef::Config[:node_name] = "webmonkey.example.com"
    @knife = Chef::Knife::TagList.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
  end

  describe "run" do
    it "can list tags on a node" do
      expected = %w(sadtag happytag)
      @node.tags.should == expected
      @knife.should_receive(:output).with(expected)
      @knife.run
    end
  end
end