Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyBen committed Dec 30, 2024
1 parent 4d83222 commit e71071a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
12 changes: 12 additions & 0 deletions schemas/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,18 @@
],
"default": "always"
},
"enable_sourcing": {
"title": "enable_sourcing",
"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",
"type": "string",
"enum": [
"development",
"production",
"always",
"never"
],
"default": "development"
},
"partials_extension": {
"title": "partials extension",
"description": "The extension to use when reading/writing partial script snippets\nhttps://bashly.dannyb.co/usage/settings/#partials_extension",
Expand Down
2 changes: 1 addition & 1 deletion spec/approvals/cli/preview/no-args
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
...
run "$@"
run "$@"
2 changes: 1 addition & 1 deletion spec/bashly/commands/preview_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

it 'prints the generated cli script' do
expect { subject.execute %w[preview] }.to output_approval('cli/preview/no-args')
.except(/env bash\n.*\nrun "\$@"/m, "env bash\n...\nrun \"$@\"")
.except(/env bash\n.*\n\s*run "\$@"\n.*/m, "env bash\n...\nrun \"$@\"")
end
end
end
2 changes: 1 addition & 1 deletion spec/bashly/script/wrapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
lines = subject.code.split "\n"
expect(lines[0..13].join("\n")).to match_approval('script/wrapper/code')
.except(/\d+\.\d+\.\d+(\.rc\d)?/)
expect(lines[-1]).to eq 'run "$@"'
expect(lines[-2]).to eq ' run "$@"'
end
end

Expand Down
8 changes: 8 additions & 0 deletions support/schema/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ properties:
type: string
enum: *feature_toggles
default: always
enable_sourcing:
title: enable_sourcing
description: |-
Whether to wrap the script execution in a condition that checks if the script is sourced
https://bashly.dannyb.co/usage/settings/#enable_sourcing
type: string
enum: *feature_toggles
default: development
partials_extension:
title: partials extension
description: |-
Expand Down

0 comments on commit e71071a

Please sign in to comment.