Sha256: d43aa445870fb7e62643e8e4028d57f72b36d8894e5f15f1b5c07f3bd896ae35

Contents?: true

Size: 1.67 KB

Versions: 38

Compression:

Stored size: 1.67 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
          subject.use_bundler.should be_true
        end

        it "uses bundle exec to find cucumber and libraries" do
          subject.cmd.should == [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
          subject.use_bundler.should be_false
        end

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

      end


    end

  end
end

Version data entries

38 entries across 36 versions & 9 rubygems

Version Path
cucumber-1.1.9 spec/cucumber/rake/forked_spec.rb
cucumber-1.1.8 spec/cucumber/rake/forked_spec.rb
cucumber-1.1.7 spec/cucumber/rake/forked_spec.rb
cucumber-1.1.6 spec/cucumber/rake/forked_spec.rb
cucumber-1.1.5 spec/cucumber/rake/forked_spec.rb
cucumber-1.1.4 spec/cucumber/rake/forked_spec.rb
cucumber-1.1.3 spec/cucumber/rake/forked_spec.rb
cucumber-1.1.2 spec/cucumber/rake/forked_spec.rb
cucumber-1.1.1 spec/cucumber/rake/forked_spec.rb
js-log-cucumber-1.0.2 spec/cucumber/rake/forked_spec.rb
cucumber-1.1.0 spec/cucumber/rake/forked_spec.rb
cucumber-1.0.6 spec/cucumber/rake/forked_spec.rb
cucumber-1.0.5 spec/cucumber/rake/forked_spec.rb
cucumber-1.0.4 spec/cucumber/rake/forked_spec.rb
cucumber-1.0.3 spec/cucumber/rake/forked_spec.rb
cucumber-1.0.2 spec/cucumber/rake/forked_spec.rb
cucumber-1.0.1 spec/cucumber/rake/forked_spec.rb
cucumber-1.0.0 spec/cucumber/rake/forked_spec.rb