Skip to content

Commit 29767e9

Browse files
author
Kevin Paulisse
committed
Use shared examples for these tests
1 parent 82ca6f6 commit 29767e9

1 file changed

Lines changed: 1 addition & 23 deletions

File tree

spec/octocatalog-diff/tests/catalog-diff/cli/options/environment_spec.rb

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,6 @@
44

55
describe OctocatalogDiff::CatalogDiff::Cli::Options do
66
describe '#opt_environment' do
7-
it 'should handle --environment' do
8-
result = run_optparse(['--environment', 'fizzbuzz'])
9-
expect(result[:from_environment]).to eq('fizzbuzz')
10-
expect(result[:to_environment]).to eq('fizzbuzz')
11-
end
12-
13-
it 'should handle --to-environment' do
14-
result = run_optparse(['--to-environment', 'fizzbuzz'])
15-
expect(result[:from_environment]).to be_nil
16-
expect(result[:to_environment]).to eq('fizzbuzz')
17-
end
18-
19-
it 'should handle --from-environment' do
20-
result = run_optparse(['--from-environment', 'fizzbuzz'])
21-
expect(result[:from_environment]).to eq('fizzbuzz')
22-
expect(result[:to_environment]).to be_nil
23-
end
24-
25-
it 'should handle --from-environment + --to-environment' do
26-
result = run_optparse(['--from-environment', 'fizzbuzz', '--to-environment', 'production'])
27-
expect(result[:from_environment]).to eq('fizzbuzz')
28-
expect(result[:to_environment]).to eq('production')
29-
end
7+
include_examples 'global string option', 'environment', :environment
308
end
319
end

0 commit comments

Comments
 (0)