Sha256: fda94590d263d8c41ef04a1bcce6654c94fd45fa84b5f3e5a730f60282dc4fd4

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe CruiseStatus do
  describe "on failed build" do
    before :each do
      @parser = mock( "failing feed parser",
        :failures => ["failed build"],
        :check => nil
      )
      CruiseStatus::FeedParser.stub!( :for ).and_return @parser
      
      @status = CruiseStatus.new 'ccrb.rss'
    end
    
    it "delegates #failures to the feed parser" do
      @parser.should_receive( :failures ).and_return :failures
      @status.failures.should == :failures
    end
    
    it "#pass? is false" do
      @status.should_not be_pass
    end
  end
  
  describe "on passing build" do
    before :each do
      @parser = mock( "passing feed parser",
        :failures => [],
        :check => nil
      )
      CruiseStatus::FeedParser.stub!( :for ).and_return @parser
      
      @status = CruiseStatus.new 'ccrb.rss'
    end
    
    it "delegates #failures to the feed parser" do
      @parser.should_receive( :failures ).and_return :failures
      @status.failures.should == :failures
    end
    
    it "#pass? is true" do
      @status.should be_pass
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cruisestatus-1.3.2 spec/cruisestatus_spec.rb
cruisestatus-1.3.1 spec/cruisestatus_spec.rb