Skip to content

Commit c15e817

Browse files
committed
improve example spec isolation
1 parent c31427b commit c15e817

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

examples/command-default-force/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ commands:
2424
- name: all
2525
help: Run all tests
2626

27-
# By setting the `default: force`, it will be executed when the command line
28-
# is not recognized, and when it is empty.
27+
# By setting `default: force`, it will be executed when the command line is
28+
# not recognized, and when it is empty.
2929
default: force
3030

3131
- name: only

examples/command-default-force/src/bashly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ commands:
66
- name: all
77
help: Run all tests
88

9-
# By setting the `default: force`, it will be executed when the command line
10-
# is not recognized, and when it is empty.
9+
# By setting `default: force`, it will be executed when the command line is
10+
# not recognized, and when it is empty.
1111
default: force
1212

1313
- name: only

spec/bashly/integration/examples_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616

1717
test_cases = fixtures + examples
1818

19-
# To test one example, run: EXAMPLE=yaml bundle exec run spec examples
20-
test_cases = ["examples/#{ENV['EXAMPLE']}"] if ENV['EXAMPLE']
21-
19+
# To only test examples containing a certain string in their path, run:
20+
# EXAMPLE=yaml bundle exec run spec examples
2221
leeway = ENV['CI'] ? 30 : 0
2322

2423
test_cases.each do |example|
2524
approval_name = example.gsub 'spec/fixtures/workspaces', 'fixtures'
2625

26+
next if ENV['EXAMPLE'] and !example.include? ENV['EXAMPLE']
27+
2728
describe example do
2829
it 'is executed properly' do
2930
output = 'not executed'

0 commit comments

Comments
 (0)