spec/daigaku/test_example_spec.rb in daigaku-0.3.0 vs spec/daigaku/test_example_spec.rb in daigaku-0.4.0

- old
+ new

@@ -1,33 +1,36 @@ require 'spec_helper' describe Daigaku::TestExample do + subject { Daigaku::TestExample.new(description: '', status: '') } - it { is_expected.to respond_to :description } - it { is_expected.to respond_to :status } - it { is_expected.to respond_to :message } + 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 + context 'when passed' do let(:description) { test_passed_json_parsed[:examples].first[:description] } - let(:status) { test_passed_json_parsed[:examples].first[:status] } + let(:status) { test_passed_json_parsed[:examples].first[:status] } - subject { Daigaku::TestExample.new(description: description, status: status) } + subject do + Daigaku::TestExample.new(description: description, status: status) + end - it "has the prescribed description" do + it 'has the prescribed description' do expect(subject.description).to eq description end - it "has the prescribed status" do + it 'has the prescribed status' do expect(subject.status).to eq status end - it "has the prescribed message" do + it 'has the prescribed message' do expect(subject.message).to eq example_passed_message end end - context "when failed:" do + 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 @@ -36,19 +39,18 @@ status: status, message: message ) end - it "has the prescribed description" do + it 'has the prescribed description' do expect(subject.description).to eq description end - it "has the prescribed status" do + it 'has the prescribed status' do expect(subject.status).to eq status end - it "has the prescribed message" do + it 'has the prescribed message' do expect(subject.message).to eq message end end - end