Sha256: b8eac7eb18faab48663937088fb9c055dc1cc9a354e313822ab6ee3bfda9f178

Contents?: true

Size: 882 Bytes

Versions: 2

Compression:

Stored size: 882 Bytes

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), "helper")


describe CiStatus::CruiseControl do

  before  { stub_request(:get, "http://example.com/cc.xml").to_return(:body => cc_fixture) }
  subject { CiStatus::CruiseControl.new("http://example.com/cc.xml") }

  it "surfaces the input URL" do
    assert_equal "http://example.com/cc.xml", subject.url
  end

  describe "#projects" do
    it "returns the expected projects" do
      assert_equal 3, subject.projects.size

      project = subject.projects.first

      assert_equal "https://jenkins.example.com/job/Analytics/", project.url
      assert_equal "Analytics", project.name
      assert_equal "Success", project.status
      assert project.success?
    end
  end

  describe "#[]" do
    it "allows looking up by name" do
      assert subject["Analytics"]
      refute subject["Horseface"]
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ci_status-1.0.0 test/test_cruise_control.rb
ci_status-0.1.1 test/test_cruise_control.rb