Sha256: 0d3bb887529a67b319e7158e848f172d01134ffc64b40d7d0dc78ae20fee13bf

Contents?: true

Size: 1.84 KB

Versions: 11

Compression:

Stored size: 1.84 KB

Contents

require "spec_helper"

describe CFoundry::V2::AppEvent do
  let(:client) { fake_client }

  let(:app) { fake :app }

  subject { described_class.new("app-event-1", client) }

  it "has an app" do
    subject.app = app
    expect(subject.app).to eq(app)
  end

  describe "#instance_guid" do
    it "has an instance guid" do
      subject.instance_guid = "foo"
      expect(subject.instance_guid).to eq("foo")
    end

    context "when an invalid value is assigned" do
      it "raises a Mismatch exception" do
        expect {
          subject.instance_guid = 123
        }.to raise_error(CFoundry::Mismatch)
      end
    end
  end

  describe "#instance_index" do
    it "has an instance index" do
      subject.instance_index = 123
      expect(subject.instance_index).to eq(123)
    end

    context "when an invalid value is assigned" do
      it "raises a Mismatch exception" do
        expect {
          subject.instance_index = "wrong"
        }.to raise_error(CFoundry::Mismatch)
      end
    end
  end

  describe "#exit_status" do
    it "has an instance index" do
      subject.exit_status = 123
      expect(subject.exit_status).to eq(123)
    end

    context "when an invalid value is assigned" do
      it "raises a Mismatch exception" do
        expect {
          subject.exit_status = "wrong"
        }.to raise_error(CFoundry::Mismatch)
      end
    end
  end

  describe "#exit_description" do
    it "defaults to an empty string" do
      expect(subject.fake.exit_description).to eq("")
    end

    it "has an instance guid" do
      subject.exit_description = "foo"
      expect(subject.exit_description).to eq("foo")
    end

    context "when an invalid value is assigned" do
      it "raises a Mismatch exception" do
        expect {
          subject.exit_description = 123
        }.to raise_error(CFoundry::Mismatch)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cfoundry-1.5.3 spec/cfoundry/v2/app_event_spec.rb
cfoundry-1.5.2 spec/cfoundry/v2/app_event_spec.rb
cfoundry-1.5.1 spec/cfoundry/v2/app_event_spec.rb
cfoundry-1.5.0 spec/cfoundry/v2/app_event_spec.rb
cfoundry-1.4.0 spec/cfoundry/v2/app_event_spec.rb
cfoundry-1.3.0 spec/cfoundry/v2/app_event_spec.rb
cfoundry-1.2.0 spec/cfoundry/v2/app_event_spec.rb
cfoundry-1.1.0.rc4 spec/cfoundry/v2/app_event_spec.rb
cfoundry-1.1.0.rc3 spec/cfoundry/v2/app_event_spec.rb
cfoundry-1.1.0.rc2 spec/cfoundry/v2/app_event_spec.rb
cfoundry-1.1.0.rc1 spec/cfoundry/v2/app_event_spec.rb