Sha256: 46964b5c236e6b86bc7ded7a52332d6ca0daa0f5a88377ef69158c5627b88f7c

Contents?: true

Size: 823 Bytes

Versions: 3

Compression:

Stored size: 823 Bytes

Contents

require 'spec_helper'

describe Status::Jenkins do
  class Test
    include Status::Jenkins
  end

  subject {Test.new}

  before do
    Status.stub(:config => stub(:attrs => {}))
    Status.stub(:branch => "")

    stub(Status::Request)
  end

  context "#state" do
    it "is Green when ci result is success" do
      Status::Request.stub(:new => stub(:get => {"building" => false, "result" => "success"}))
      subject.state.should == "Green"
    end

    it "is Building when ci result is building" do
      Status::Request.stub(:new => stub(:get => {"building" => true, "result" => "success"}))
      subject.state.should == "building"
    end

    it "is Building when ci result is not found" do
      Status::Request.stub(:new => stub(:get => "not found"))
      subject.state.should == "building"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
update_status-0.1.2 spec/status/jenkins_spec.rb
update_status-0.1.1 spec/status/jenkins_spec.rb
update_status-0.1.0 spec/status/jenkins_spec.rb