Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit 4bc5736

Browse files
committed
fix: don't assume handler is installed as global executable
Close #4
1 parent f68f35e commit 4bc5736

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

features/execution_order.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Feature: Execution order
22

33
Background:
4-
Given I have "{{my-executable-path}}" command installed
5-
And I have "dredd" command installed
4+
Given I have Dredd installed
65
And a file named "server.js" with:
76
"""
87
require('http')

features/failing_transaction.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Feature: Failing a transaction
22

33
Background:
4-
Given I have "{{my-executable-path}}" command installed
5-
And I have "dredd" command installed
4+
Given I have Dredd installed
65
And a file named "server.js" with:
76
"""
87
require('http')

features/hook_handlers.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Feature: Hook handlers
22

33
Background:
4-
Given I have "{{my-executable-path}}" command installed
5-
And I have "dredd" command installed
4+
Given I have Dredd installed
65
And a file named "server.js" with:
76
"""
87
require('http')

features/multiple_hookfiles.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Feature: Multiple hook files with a glob
22

33
Background:
4-
Given I have "{{my-executable-path}}" command installed
5-
And I have "dredd" command installed
4+
Given I have Dredd installed
65
And a file named "server.js" with:
76
"""
87
require('http')

features/support/steps.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,8 @@ After(async function hook() {
3232
});
3333

3434

35-
Given(/^I have "([^"]+)" command installed$/, (match) => {
36-
const command = match === 'dredd'
37-
? DREDD_BIN
38-
: match;
39-
which.sync(command); // throws if the command is not found
35+
Given('I have Dredd installed', () => {
36+
which.sync(DREDD_BIN); // throws if not found
4037
});
4138

4239
Given(/^a file named "([^"]+)" with:$/, function step(filename, content) {
@@ -48,9 +45,8 @@ Given(/^I set the environment variables to:$/, function step(env) {
4845
});
4946

5047

51-
When(/^I run `([^`]+)`$/, function step(match) {
52-
const command = match.replace(/^dredd(?= )/, DREDD_BIN);
53-
this.proc = childProcess.spawnSync(command, [], {
48+
When(/^I run `dredd ([^`]+)`$/, function step(args) {
49+
this.proc = childProcess.spawnSync(`${DREDD_BIN} ${args}`, [], {
5450
shell: true,
5551
cwd: this.dir,
5652
env: this.env,

0 commit comments

Comments
 (0)