Sha256: 43ee8847b095091935d2254d43ff100ef7a70a1d7e7b569c55c731910b0bcab1

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

module TurnipFormatter
  class Step
    describe Failure do
      let(:description) { ['StepName', 'Keyword', ['Docstring']] }
      let(:step) { ::TurnipFormatter::Step.new(description) }
      let(:failure_step) { step.dup.extend TurnipFormatter::Step::Failure }      

      describe '#attention?' do
        subject { failure_step.attention? }
        it { should be_true }
      end

      describe '#status' do
        subject { failure_step.status }
        it { should eq 'failure' }
      end

      describe '#attention' do
        it 'should have been implemented' do
          expect(step).not_to respond_to(:attention)
          expect(failure_step).to respond_to(:attention)
        end

        it 'should set exception informaton' do
          exception = StandardError.new
          expect(exception.backtrace).to be_nil

          failure_step.attention(exception, ['/path/to/error.rb: 10'])

          expect(failure_step.docs[:source]).to eq '/path/to/error.rb: 10'
          failure_step.docs[:exception].tap do |e|
            expect(e).to eql(exception)
            expect(e.backtrace.first).to eq '/path/to/error.rb: 10'
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
turnip_formatter-0.0.1 spec/turnip_formatter/step/failure_spec.rb