~ubuntu-branches/ubuntu/trusty/puppet/trusty

« back to all changes in this revision

Viewing changes to spec/unit/transaction/report_spec.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-22 14:08:22 UTC
  • mfrom: (1.1.25) (3.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20111022140822-odxde5lohc45yhuz
Tags: 2.7.6-1
* New upstream release (CVE-2011-3872)
* Remove cherry-picked "groupadd_aix_warning" patch
* Install all new manpages

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
    Puppet::Util::Storage.stubs(:store)
10
10
  end
11
11
 
12
 
  it "should set its host name to the certname" do
13
 
    Puppet.settings.expects(:value).with(:certname).returns "myhost"
14
 
    Puppet::Transaction::Report.new("apply").host.should == "myhost"
 
12
  it "should set its host name to the node_name_value" do
 
13
    Puppet[:node_name_value] = 'mynode'
 
14
    Puppet::Transaction::Report.new("apply").host.should == "mynode"
15
15
  end
16
16
 
17
17
  it "should return its host name as its name" do
103
103
      report.expects(:host).returns "me"
104
104
      report.name.should == "me"
105
105
    end
106
 
 
107
 
    after do
108
 
      Puppet::Util::Cacher.expire
109
 
    end
110
106
  end
111
107
 
112
108
  describe "when computing exit status" do
154
150
 
155
151
    def add_statuses(count, type = :file)
156
152
      count.times do |i|
157
 
        status = Puppet::Resource::Status.new(Puppet::Type.type(type).new(:title => "/my/path#{i}"))
 
153
        status = Puppet::Resource::Status.new(Puppet::Type.type(type).new(:title => make_absolute("/my/path#{i}")))
158
154
        yield status if block_given?
159
155
        @report.add_resource_status status
160
156
      end
208
204
    end
209
205
 
210
206
    describe "for times" do
211
 
      it "should provide the total amount of time for each resource type" do
 
207
      it "should provide the total amount of time for each resource type", :fails_on_windows => true do
212
208
        add_statuses(3, :file) do |status|
213
209
          status.evaluation_time = 1
214
210
        end