Sha256: c8eba334f42ace54d45ed519fa504d1e96ae76607b21c352ddb158c543e39567

Contents?: true

Size: 1.47 KB

Versions: 3

Compression:

Stored size: 1.47 KB

Contents

require 'spec_helper'

module TurnipFormatter::Scenario
  describe Pass do
    let(:scenario) { ::TurnipFormatter::Scenario::Pass.new(example) }

    include_context 'turnip_formatter scenario setup'
    include_context 'turnip_formatter standard scenario metadata'

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

    context 'Not Turnip example' do
      context 'Not passed example' do
        include_context 'turnip_formatter failure scenario setup'

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

      context 'not exist feature file' do
        let(:metadata) do
          metadata = super()
          metadata[:file_path] = '/path/to/hoge.rb'
          metadata
        end

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

      context 'not exist step information' do
        let(:metadata) { { file_path: '/path/to/hoge.rb' } }

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
turnip_formatter-0.1.1 spec/turnip_formatter/scenario/pass_spec.rb
turnip_formatter-0.1.0 spec/turnip_formatter/scenario/pass_spec.rb
turnip_formatter-0.0.6 spec/turnip_formatter/scenario/pass_spec.rb