|
36 | 36 | end
|
37 | 37 | end
|
38 | 38 |
|
39 |
| - context "with a :rvm option" do |
40 |
| - it "executes cucumber through the rvm versions" do |
41 |
| - req = @lib_path.join("guard/cucumber/notification_formatter.rb") |
42 |
| - expect(runner).to receive(:system).with( |
43 |
| - "rvm 1.8.7,1.9.2 exec bundle exec cucumber"\ |
44 |
| - " --require #{ req }"\ |
45 |
| - " --format Guard::Cucumber::NotificationFormatter"\ |
46 |
| - " --out #{ null_device }"\ |
47 |
| - " --require features features" |
48 |
| - ) |
49 |
| - runner.run(["features"], rvm: ["1.8.7", "1.9.2"]) |
50 |
| - end |
51 |
| - end |
52 |
| - |
53 |
| - context "with a :command_prefix option" do |
54 |
| - it "executes cucumber with the command_prefix option" do |
55 |
| - req = @lib_path.join("guard/cucumber/notification_formatter.rb") |
56 |
| - expect(runner).to receive(:system).with( |
57 |
| - "xvfb-run bundle exec cucumber "\ |
58 |
| - "--require #{ req } "\ |
59 |
| - "--format Guard::Cucumber::NotificationFormatter "\ |
60 |
| - "--out #{ null_device } "\ |
61 |
| - "--require features features" |
62 |
| - ) |
63 |
| - runner.run(["features"], command_prefix: "xvfb-run") |
64 |
| - end |
| 39 | + it "runs cucumber according to passed cmd option" do |
| 40 | + req = @lib_path.join("guard/cucumber/notification_formatter.rb") |
| 41 | + expect(runner).to receive(:system).with( |
| 42 | + "xvfb-run bundle exec cucumber "\ |
| 43 | + "--require #{ req } "\ |
| 44 | + "--format Guard::Cucumber::NotificationFormatter "\ |
| 45 | + "--out #{ null_device } "\ |
| 46 | + "--require features features" |
| 47 | + ) |
| 48 | + runner.run(["features"], cmd: "xvfb-run bundle exec cucumber") |
65 | 49 | end
|
66 |
| - |
67 |
| - context "with a :bundler option" do |
68 |
| - it "runs without bundler when false" do |
69 |
| - req = @lib_path.join("guard/cucumber/notification_formatter.rb") |
70 |
| - expect(runner).to receive(:system).with( |
71 |
| - "cucumber"\ |
72 |
| - " --require #{ req }"\ |
73 |
| - " --format Guard::Cucumber::NotificationFormatter"\ |
74 |
| - " --out #{ null_device }"\ |
75 |
| - " --require features features" |
76 |
| - ) |
77 |
| - runner.run(["features"], bundler: false) |
78 |
| - end |
79 |
| - end |
80 |
| - |
| 50 | + |
81 | 51 | context "with a :focus_on option" do
|
82 | 52 | it "passes the value in :focus_on to the Focuser" do
|
83 | 53 | paths = ["features"]
|
|
93 | 63 | end
|
94 | 64 | end
|
95 | 65 |
|
96 |
| - describe ":binstubs" do |
97 |
| - it "runs without Bundler with binstubs option to true and "\ |
98 |
| - "bundler option to false" do |
99 |
| - req = @lib_path.join("guard/cucumber/notification_formatter.rb") |
100 |
| - expect(subject).to receive(:system).with( |
101 |
| - "bin/cucumber"\ |
102 |
| - " --require #{ req }"\ |
103 |
| - " --format Guard::Cucumber::NotificationFormatter"\ |
104 |
| - " --out #{ null_device }"\ |
105 |
| - " --require features features" |
106 |
| - ).and_return(true) |
107 |
| - subject.run(["features"], bundler: false, binstubs: true) |
108 |
| - end |
109 |
| - |
110 |
| - it "runs with Bundler and binstubs with bundler option to true "\ |
111 |
| - "and binstubs option to true" do |
112 |
| - req = @lib_path.join("guard/cucumber/notification_formatter.rb") |
113 |
| - expect(subject).to receive(:system).with( |
114 |
| - "bundle exec bin/cucumber"\ |
115 |
| - " --require #{ req }"\ |
116 |
| - " --format Guard::Cucumber::NotificationFormatter"\ |
117 |
| - " --out #{ null_device }"\ |
118 |
| - " --require features features" |
119 |
| - ).and_return(true) |
120 |
| - subject.run(["features"], bundler: true, binstubs: true) |
121 |
| - end |
122 |
| - |
123 |
| - it "runs with Bundler and binstubs with bundler option unset "\ |
124 |
| - "and binstubs option to true" do |
125 |
| - req = @lib_path.join("guard/cucumber/notification_formatter.rb") |
126 |
| - expect(subject).to receive(:system).with( |
127 |
| - "bundle exec bin/cucumber"\ |
128 |
| - " --require #{ req } "\ |
129 |
| - "--format Guard::Cucumber::NotificationFormatter "\ |
130 |
| - "--out #{ null_device }"\ |
131 |
| - " --require features features" |
132 |
| - ).and_return(true) |
133 |
| - subject.run(["features"], binstubs: true) |
134 |
| - end |
135 |
| - |
136 |
| - it "runs with Bundler and binstubs with bundler option unset, "\ |
137 |
| - "binstubs option to true and all_after_pass option to true" do |
138 |
| - req = @lib_path.join("guard/cucumber/notification_formatter.rb") |
139 |
| - expect(subject).to receive(:system).with( |
140 |
| - "bundle exec bin/cucumber"\ |
141 |
| - " --require #{ req } "\ |
142 |
| - "--format Guard::Cucumber::NotificationFormatter"\ |
143 |
| - " --out #{ null_device }"\ |
144 |
| - " --require features features" |
145 |
| - ).and_return(true) |
146 |
| - subject.run(["features"], binstubs: true, all_after_pass: true) |
147 |
| - end |
148 |
| - |
149 |
| - it "runs with Bundler and binstubs with bundler option unset, "\ |
150 |
| - "binstubs option to true and all_on_start option to true" do |
151 |
| - req = @lib_path.join("guard/cucumber/notification_formatter.rb") |
152 |
| - expect(subject).to receive(:system).with( |
153 |
| - "bundle exec bin/cucumber --require #{ req } "\ |
154 |
| - "--format Guard::Cucumber::NotificationFormatter "\ |
155 |
| - "--out #{ null_device } --require features features" |
156 |
| - ).and_return(true) |
157 |
| - subject.run(["features"], binstubs: true, all_on_start: true) |
158 |
| - end |
159 |
| - |
160 |
| - it "runs with Bundler and binstubs with bundler option unset, "\ |
161 |
| - "binstubs option to true, all_on_start option to true and "\ |
162 |
| - "all_after_pass option to true" do |
163 |
| - req = @lib_path.join("guard/cucumber/notification_formatter.rb") |
164 |
| - |
165 |
| - expect(subject).to receive(:system).with( |
166 |
| - "bundle exec bin/cucumber --require #{ req } "\ |
167 |
| - "--format Guard::Cucumber::NotificationFormatter "\ |
168 |
| - "--out #{ null_device } --require features features" |
169 |
| - ).and_return(true) |
170 |
| - |
171 |
| - subject.run( |
172 |
| - ["features"], |
173 |
| - binstubs: true, |
174 |
| - all_after_pass: true, |
175 |
| - all_on_start: true) |
176 |
| - end |
177 |
| - end |
178 |
| - |
179 |
| - context "with a :cli option" do |
| 66 | + context "with a :cmd_additional_args option" do |
180 | 67 | it "appends the cli arguments when calling cucumber" do
|
181 | 68 | req = @lib_path.join("guard/cucumber/notification_formatter.rb")
|
182 | 69 | expect(runner).to receive(:system).with(
|
183 |
| - "bundle exec cucumber --custom command --require #{req} "\ |
| 70 | + "cucumber --require #{req} "\ |
184 | 71 | "--format Guard::Cucumber::NotificationFormatter "\
|
185 |
| - "--out #{ null_device } --require features features") |
186 |
| - runner.run(["features"], cli: "--custom command") |
| 72 | + "--out #{ null_device } --require features "\ |
| 73 | + "--custom command "\ |
| 74 | + "features") |
| 75 | + runner.run(["features"], cmd_additional_args: "--custom command") |
187 | 76 | end
|
188 | 77 | end
|
189 | 78 |
|
190 | 79 | context "with a :notification option" do
|
191 | 80 | it "does not add the guard notification listener" do
|
192 | 81 | expect(runner).to receive(:system).with(
|
193 |
| - "bundle exec cucumber features" |
| 82 | + "cucumber features" |
194 | 83 | )
|
195 | 84 | runner.run(["features"], notification: false)
|
196 | 85 | end
|
|
0 commit comments