Sha256: c0b334816cc32a0ec0fea7084553dab5002edf821b5f48517ce8671fd902a2d3

Contents?: true

Size: 1.29 KB

Versions: 16

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

module TurnipFormatter::Scenario
  describe Failure do
    let(:scenario) { ::TurnipFormatter::Scenario::Failure.new(failure_example) }
    include_context 'turnip_formatter standard scenario metadata'
    include_context 'turnip_formatter failure scenario setup'

    context 'Turnip example' do
      let(:failure_example) do
        example.exception.backtrace.push ":in step:0 `"
        example
      end

      describe '#validation' do
        it 'should not raise exception' do
          expect { scenario.validation }.not_to raise_error
        end
      end
    end

    context 'Not Turnip example' do
      let(:failure_example) do
        example
      end

      context 'Not failed example' do
        include_context 'turnip_formatter scenario setup'

        describe '#validation' do
          it 'should raise exception' do
            expect {
              scenario.validation
            }.to raise_error NotFailedScenarioError
          end
        end        
      end

      context 'Not exist failed step information' do
        describe '#validation' do
          it 'should raise exception' do
            expect {
              scenario.validation
            }.to raise_error NoExistFailedStepInformationError
          end
        end        
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
turnip_formatter-0.2.11 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.2.10 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.2.9 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.2.8 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.2.7 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.2.6 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.2.5 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.2.4 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.2.3 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.2.2 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.2.1 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.2.0 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.1.2 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.1.1 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.1.0 spec/turnip_formatter/scenario/failure_spec.rb
turnip_formatter-0.0.6 spec/turnip_formatter/scenario/failure_spec.rb