Sha256: a0cdaf4c3348edc0877b21d7500b44ead9b252e95275fa3b18383d14c045e195

Contents?: true

Size: 1.44 KB

Versions: 6

Compression:

Stored size: 1.44 KB

Contents

require 'spec_helper'

describe Daigaku::TestExample do

    it { is_expected.to respond_to :description }
    it { is_expected.to respond_to :status }
    it { is_expected.to respond_to :message }

  context "when passed:" do
    let(:description) { test_passed_json_parsed[:examples].first[:description] }
    let(:status) { test_passed_json_parsed[:examples].first[:status] }

    subject { Daigaku::TestExample.new(description: description, status: status) }

    it "has the prescribed description" do
      expect(subject.description).to eq description
    end

    it "has the prescribed status" do
      expect(subject.status).to eq status
    end

    it "has the prescribed message" do
      expect(subject.message).to eq example_passed_message
    end
  end

  context "when failed:" do
    let(:description) { test_failed_json_parsed[:examples].first[:description] }
    let(:status) { test_failed_json_parsed[:examples].first[:status] }
    let(:message) { test_failed_json_parsed[:examples].first[:exception][:message] }

    subject do
      Daigaku::TestExample.new(
        description: description,
        status: status,
        message: message
      )
    end

    it "has the prescribed description" do
      expect(subject.description).to eq description
    end

    it "has the prescribed status" do
      expect(subject.status).to eq status
    end

    it "has the prescribed message" do
      expect(subject.message).to eq message
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
daigaku-0.3.0 spec/daigaku/test_example_spec.rb
daigaku-0.2.0 spec/daigaku/test_example_spec.rb
daigaku-0.1.1 spec/daigaku/test_example_spec.rb
daigaku-0.1.0 spec/daigaku/test_example_spec.rb
daigaku-0.0.2 spec/daigaku/test_example_spec.rb
daigaku-0.0.1 spec/daigaku/test_example_spec.rb