Skip to content

Commit e71071a

Browse files
committed
fix tests
1 parent 4d83222 commit e71071a

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

schemas/settings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,18 @@
201201
],
202202
"default": "always"
203203
},
204+
"enable_sourcing": {
205+
"title": "enable_sourcing",
206+
"description": "Whether to wrap the script execution in a condition that checks if the script is sourced\nhttps://bashly.dannyb.co/usage/settings/#enable_sourcing",
207+
"type": "string",
208+
"enum": [
209+
"development",
210+
"production",
211+
"always",
212+
"never"
213+
],
214+
"default": "development"
215+
},
204216
"partials_extension": {
205217
"title": "partials extension",
206218
"description": "The extension to use when reading/writing partial script snippets\nhttps://bashly.dannyb.co/usage/settings/#partials_extension",

spec/approvals/cli/preview/no-args

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22
...
3-
run "$@"
3+
run "$@"

spec/bashly/commands/preview_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
it 'prints the generated cli script' do
1919
expect { subject.execute %w[preview] }.to output_approval('cli/preview/no-args')
20-
.except(/env bash\n.*\nrun "\$@"/m, "env bash\n...\nrun \"$@\"")
20+
.except(/env bash\n.*\n\s*run "\$@"\n.*/m, "env bash\n...\nrun \"$@\"")
2121
end
2222
end
2323
end

spec/bashly/script/wrapper_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
lines = subject.code.split "\n"
1212
expect(lines[0..13].join("\n")).to match_approval('script/wrapper/code')
1313
.except(/\d+\.\d+\.\d+(\.rc\d)?/)
14-
expect(lines[-1]).to eq 'run "$@"'
14+
expect(lines[-2]).to eq ' run "$@"'
1515
end
1616
end
1717

support/schema/settings.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ properties:
173173
type: string
174174
enum: *feature_toggles
175175
default: always
176+
enable_sourcing:
177+
title: enable_sourcing
178+
description: |-
179+
Whether to wrap the script execution in a condition that checks if the script is sourced
180+
https://bashly.dannyb.co/usage/settings/#enable_sourcing
181+
type: string
182+
enum: *feature_toggles
183+
default: development
176184
partials_extension:
177185
title: partials extension
178186
description: |-

0 commit comments

Comments
 (0)