8
7
describe Task::ForkedCucumberRunner do
10
8
let(:libs) { ['lib'] }
11
9
let(:binary) { Cucumber::BINARY }
12
10
let(:cucumber_opts) { ['--cuke-option'] }
13
11
let(:feature_files) { ['./some.feature'] }
15
13
context "when running with bundler" do
17
14
let(:bundler) { true }
19
16
subject { Task::ForkedCucumberRunner.new(
20
17
libs, binary, cucumber_opts, bundler, feature_files) }
22
19
it "does use bundler if bundler is set to true" do
23
subject.use_bundler.should be_true
20
expect(subject.use_bundler).to be true
26
23
it "uses bundle exec to find cucumber and libraries" do
27
subject.cmd.should == [Cucumber::RUBY_BINARY,
32
'--cuke-option'] + feature_files
24
expect(subject.cmd).to eq [Cucumber::RUBY_BINARY,
29
'--cuke-option'] + feature_files
37
33
context "when running without bundler" do
39
34
let(:bundler) { false }
41
36
subject { Task::ForkedCucumberRunner.new(
42
37
libs, binary, cucumber_opts, bundler, feature_files) }
44
39
it "does not use bundler if bundler is set to false" do
45
subject.use_bundler.should be_false
40
expect(subject.use_bundler).to be false
48
43
it "uses well known cucumber location and specified libraries" do
49
subject.cmd.should == [Cucumber::RUBY_BINARY,
52
"\"#{Cucumber::BINARY }\"",
53
"--cuke-option"] + feature_files
44
expect(subject.cmd).to eq [Cucumber::RUBY_BINARY,
47
"\"#{Cucumber::BINARY }\"",
48
"--cuke-option"] + feature_files