Sha256: 8caa167e46f36e9d300d7d793d1d750357dcd3d0a456f301a7b57c206db8e538

Contents?: true

Size: 1.58 KB

Versions: 7

Compression:

Stored size: 1.58 KB

Contents

require 'tempfile'
require 'parallel_tests/cucumber/scenarios'

module ParallelTests
  module Cucumber
    describe Scenarios do
      describe '.all' do
        context 'by default' do
          let(:feature_file) do
            Tempfile.new('grouper.feature').tap do |feature|
              feature.write <<-EOS
                Feature: Grouping by scenario

                  Scenario: First
                    Given I do nothing

                  Scenario: Second
                    Given I don't do anything
              EOS
              feature.rewind
            end
          end

          it 'returns all the scenarios' do
            scenarios = Scenarios.all([feature_file.path])
            scenarios.should eq %W(#{feature_file.path}:3 #{feature_file.path}:6)
          end
        end

        context 'with tags' do
          let(:feature_file) do
            Tempfile.new('grouper.feature').tap do |feature|
              feature.write <<-EOS
                Feature: Grouping by scenario

                  @wip
                  Scenario: First
                    Given I do nothing

                  Scenario: Second
                    Given I don't do anything

                  @ignore
                  Scenario: Third
                    Given I am ignored
              EOS
              feature.rewind
            end
          end

          it 'ignores those scenarios' do
            scenarios = Scenarios.all([feature_file.path], :ignore_tag_pattern => '@ignore, @wip')
            scenarios.should eq %W(#{feature_file.path}:7)
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
parallel_tests-0.16.10 spec/parallel_tests/cucumber/scenarios_spec.rb
parallel_tests-0.16.9 spec/parallel_tests/cucumber/scenarios_spec.rb
parallel_tests-0.16.8 spec/parallel_tests/cucumber/scenarios_spec.rb
parallel_tests-0.16.7 spec/parallel_tests/cucumber/scenarios_spec.rb
parallel_tests-0.16.6 spec/parallel_tests/cucumber/scenarios_spec.rb
parallel_tests-0.16.5 spec/parallel_tests/cucumber/scenarios_spec.rb
parallel_tests-0.16.4 spec/parallel_tests/cucumber/scenarios_spec.rb