Sha256: dc929e98f5b30ab9bf636c296aba3567747f48ce94fc7001c425271b3bd2b831

Contents?: true

Size: 1.79 KB

Versions: 5

Compression:

Stored size: 1.79 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

          it 'return scenarios with following tag' do
            scenarios = Scenarios.all([feature_file.path], :test_options => '-t @wip')
            scenarios.should eq %W(#{feature_file.path}:4)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
parallel_tests-0.16.15 spec/parallel_tests/cucumber/scenarios_spec.rb
parallel_tests-0.16.14 spec/parallel_tests/cucumber/scenarios_spec.rb
parallel_tests-0.16.13 spec/parallel_tests/cucumber/scenarios_spec.rb
parallel_tests-0.16.12 spec/parallel_tests/cucumber/scenarios_spec.rb
parallel_tests-0.16.11 spec/parallel_tests/cucumber/scenarios_spec.rb