Sha256: 9221a80312c682ca18d13891b35ba967e32f46d31f7cb99071835528c662e1ee

Contents?: true

Size: 1.49 KB

Versions: 24

Compression:

Stored size: 1.49 KB

Contents

require 'spec_helper'
require 'cucumber/rake/task'
require 'rake'

module Cucumber
  module Rake
    describe Task::ForkedCucumberRunner do
      let(:libs) { ['lib'] }
      let(:binary) { Cucumber::BINARY }
      let(:cucumber_opts) { ['--cuke-option'] }
      let(:feature_files) { ['./some.feature'] }

      context "when running with bundler" do
        let(:bundler) { true }

        subject { Task::ForkedCucumberRunner.new(
            libs, binary, cucumber_opts, bundler, feature_files) }

        it "does use bundler if bundler is set to true" do
          expect(subject.use_bundler).to be true
        end

        it "uses bundle exec to find cucumber and libraries" do
          expect(subject.cmd).to eq [Cucumber::RUBY_BINARY,
            '-S',
            'bundle',
            'exec',
            'cucumber',
            '--cuke-option'] + feature_files
        end
      end

      context "when running without bundler" do
        let(:bundler) { false }

        subject { Task::ForkedCucumberRunner.new(
            libs, binary, cucumber_opts, bundler, feature_files) }

        it "does not use bundler if bundler is set to false" do
          expect(subject.use_bundler).to be false
        end

        it "uses well known cucumber location and specified libraries" do
          expect(subject.cmd).to eq [Cucumber::RUBY_BINARY,
            "-I",
            "\"lib\"",
            "\"#{Cucumber::BINARY }\"",
            "--cuke-option"] + feature_files
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
cucumber-2.99.0 spec/cucumber/rake/forked_spec.rb
mobiusloop-0.1.5 spec/cucumber/rake/forked_spec.rb
cucumber-2.4.0 spec/cucumber/rake/forked_spec.rb
mobiusloop-0.1.3 spec/cucumber/rake/forked_spec.rb
mobiusloop-0.1.2 spec/cucumber/rake/forked_spec.rb
cucumber-2.3.3 spec/cucumber/rake/forked_spec.rb
cucumber-2.3.2 spec/cucumber/rake/forked_spec.rb
cucumber-2.3.1 spec/cucumber/rake/forked_spec.rb
cucumber-2.3.0 spec/cucumber/rake/forked_spec.rb
cucumber-2.2.0 spec/cucumber/rake/forked_spec.rb
cucumber-2.1.0 spec/cucumber/rake/forked_spec.rb
cucumber-2.0.2 spec/cucumber/rake/forked_spec.rb
cucumber-2.0.1 spec/cucumber/rake/forked_spec.rb
cucumber-2.0.0 spec/cucumber/rake/forked_spec.rb
cucumber-2.0.0.rc.5 spec/cucumber/rake/forked_spec.rb
cucumber-2.0.0.rc.4 spec/cucumber/rake/forked_spec.rb
cucumber-2.0.0.rc.3 spec/cucumber/rake/forked_spec.rb
cucumber-2.0.0.rc.2 spec/cucumber/rake/forked_spec.rb
cucumber-2.0.0.rc.1 spec/cucumber/rake/forked_spec.rb
cucumber-2.0.0.beta.5 spec/cucumber/rake/forked_spec.rb