Sha256: f7052968e598e547af080503d523b69048ed2cd094222582da36e63a4bdf9703

Contents?: true

Size: 1.68 KB

Versions: 4

Compression:

Stored size: 1.68 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../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 == [RUBY,
                                 '-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 == [RUBY,
                                 "-I",
                                 "\"lib\"",
                                 "\"#{Cucumber::BINARY }\"",
                                 "--cuke-option"] + feature_files
        end

      end


    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cucumber-0.10.7 spec/cucumber/rake/forked_spec.rb
cucumber-0.10.6 spec/cucumber/rake/forked_spec.rb
cucumber-0.10.5 spec/cucumber/rake/forked_spec.rb
cucumber-0.10.3 spec/cucumber/rake/forked_spec.rb