lucid 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/HISTORY.md +13 -9
- data/README.md +2 -6
- data/lib/lucid.rb +22 -3
- data/lib/lucid/{term/ansicolor.rb → ansicolor.rb} +34 -41
- data/lib/lucid/ast.rb +2 -2
- data/lib/lucid/ast/outline_table.rb +2 -2
- data/lib/lucid/ast/{specs.rb → spec.rb} +10 -1
- data/lib/lucid/ast/step.rb +3 -3
- data/lib/lucid/ast/step_invocation.rb +16 -16
- data/lib/lucid/ast/table.rb +1 -1
- data/lib/lucid/ast/{tdl_walker.rb → walker.rb} +15 -16
- data/lib/lucid/cli/app.rb +23 -21
- data/lib/lucid/cli/{configuration.rb → context.rb} +66 -38
- data/lib/lucid/cli/options.rb +59 -40
- data/lib/lucid/{configuration.rb → context.rb} +2 -3
- data/lib/lucid/{runtime.rb → context_loader.rb} +58 -61
- data/lib/lucid/{runtime/facade.rb → facade.rb} +5 -6
- data/lib/lucid/formatter/ansicolor.rb +15 -14
- data/lib/lucid/formatter/debug.rb +1 -1
- data/lib/lucid/formatter/usage.rb +2 -2
- data/lib/lucid/interface.rb +121 -0
- data/lib/lucid/{runtime/interface_io.rb → interface_io.rb} +2 -2
- data/lib/lucid/interface_rb/rb_language.rb +6 -23
- data/lib/lucid/interface_rb/rb_step_definition.rb +1 -2
- data/lib/lucid/{core_ext/instance_exec.rb → lang_extend.rb} +112 -69
- data/lib/lucid/{runtime/orchestrator.rb → orchestrator.rb} +36 -24
- data/lib/lucid/platform.rb +1 -1
- data/lib/lucid/{runtime/results.rb → results.rb} +10 -10
- data/lib/lucid/{tdl_builder.rb → spec_builder.rb} +26 -22
- data/lib/lucid/spec_file.rb +33 -13
- data/lib/lucid/{runtime/specs_loader.rb → spec_loader.rb} +13 -22
- data/lib/lucid/{step_definition_light.rb → step_definition_usage.rb} +2 -4
- data/lib/lucid/step_definitions.rb +4 -4
- data/spec/lucid/app_spec.rb +6 -18
- data/spec/lucid/ast/background_spec.rb +4 -4
- data/spec/lucid/ast/feature_spec.rb +7 -7
- data/spec/lucid/ast/scenario_outline_spec.rb +9 -9
- data/spec/lucid/ast/specs_spec.rb +8 -8
- data/spec/lucid/ast/step_spec.rb +5 -5
- data/spec/lucid/ast/tdl_walker_spec.rb +5 -5
- data/spec/lucid/{configuration_spec.rb → context_spec.rb} +78 -78
- data/spec/lucid/facade_spec.rb +7 -7
- data/spec/lucid/orchestrator_spec.rb +7 -7
- data/spec/lucid/pending_spec.rb +3 -3
- data/spec/lucid/progress_spec.rb +3 -3
- data/spec/lucid/rb_step_definition_spec.rb +4 -4
- data/spec/lucid/results_spec.rb +2 -2
- data/spec/lucid/runtime_spec.rb +7 -7
- metadata +20 -32
- data/bin/lucid-gen +0 -4
- data/lib/lucid/core_ext/proc.rb +0 -36
- data/lib/lucid/core_ext/string.rb +0 -9
- data/lib/lucid/generator.rb +0 -21
- data/lib/lucid/generators/project.rb +0 -64
- data/lib/lucid/generators/project/Gemfile.tt +0 -6
- data/lib/lucid/generators/project/browser-fluent.rb +0 -37
- data/lib/lucid/generators/project/driver-fluent.rb +0 -1
- data/lib/lucid/generators/project/errors.rb +0 -26
- data/lib/lucid/generators/project/events-fluent.rb +0 -33
- data/lib/lucid/interface_methods.rb +0 -125
@@ -1,16 +1,16 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
require 'lucid/ast'
|
4
|
-
require 'lucid/
|
4
|
+
require 'lucid/lang_extend'
|
5
5
|
require 'lucid/interface_rb/rb_language'
|
6
6
|
|
7
7
|
module Lucid
|
8
8
|
module AST
|
9
|
-
|
9
|
+
|
10
10
|
describe ScenarioOutline do
|
11
|
-
|
11
|
+
|
12
12
|
before do
|
13
|
-
@runtime = Lucid::
|
13
|
+
@runtime = Lucid::ContextLoader.new
|
14
14
|
@runtime.load_code_language('rb')
|
15
15
|
@dsl = Object.new
|
16
16
|
@dsl.extend(Lucid::InterfaceRb::RbLucid)
|
@@ -26,7 +26,7 @@ module Lucid
|
|
26
26
|
@dsl.Then(/^there should be (\d+) tests$/) do |n|
|
27
27
|
(@initial - @tested).should == n.to_i
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
@dsl.Then(/^there should be (\d+) tests completed$/) do |n|
|
31
31
|
@tested.should == n.to_i
|
32
32
|
end
|
@@ -69,13 +69,13 @@ module Lucid
|
|
69
69
|
end
|
70
70
|
|
71
71
|
it 'should replace all variables and call outline once for each table row' do
|
72
|
-
visitor =
|
72
|
+
visitor = Walker.new(@runtime)
|
73
73
|
visitor.should_receive(:visit_table_row).exactly(3).times
|
74
74
|
@scenario_outline.feature = double.as_null_object
|
75
75
|
@scenario_outline.accept(visitor)
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
78
|
end
|
79
|
-
|
79
|
+
|
80
80
|
end
|
81
|
-
end
|
81
|
+
end
|
@@ -2,19 +2,19 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module Lucid
|
4
4
|
module AST
|
5
|
-
describe
|
6
|
-
let(:
|
7
|
-
|
5
|
+
describe Spec do
|
6
|
+
let(:spec) { Spec.new }
|
7
|
+
|
8
8
|
def parse_feature(gherkin)
|
9
9
|
path = 'specs/test.spec'
|
10
|
-
builder = Lucid::Parser::
|
10
|
+
builder = Lucid::Parser::SpecBuilder.new(path)
|
11
11
|
parser = Gherkin::Parser::Parser.new(builder, true, 'root', false)
|
12
12
|
parser.parse(gherkin, path, 0)
|
13
13
|
builder.language = parser.i18n_language
|
14
14
|
feature = builder.result
|
15
|
-
|
15
|
+
spec.add_feature(feature)
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
it 'has a step_count' do
|
19
19
|
parse_feature(<<-GHERKIN)
|
20
20
|
Feature:
|
@@ -41,8 +41,8 @@ Feature:
|
|
41
41
|
| 8 |
|
42
42
|
GHERKIN
|
43
43
|
|
44
|
-
|
44
|
+
spec.step_count.should == (2 + 3) + (3 * (2 + 2))
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
|
-
end
|
48
|
+
end
|
data/spec/lucid/ast/step_spec.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
require 'lucid/ast'
|
4
|
-
require 'lucid/
|
4
|
+
require 'lucid/lang_extend'
|
5
5
|
|
6
6
|
module Lucid
|
7
7
|
module AST
|
8
|
-
|
8
|
+
|
9
9
|
describe Step do
|
10
10
|
let(:language) { double }
|
11
11
|
|
@@ -25,7 +25,7 @@ module Lucid
|
|
25
25
|
|
26
26
|
it 'should use empty string for the replacement of arguments in name when replace value is nil' do
|
27
27
|
step = Step.new(language, 1, 'Given', 'a <status> test')
|
28
|
-
|
28
|
+
|
29
29
|
invocation_table = Table.new([
|
30
30
|
%w(status),
|
31
31
|
[nil]
|
@@ -66,7 +66,7 @@ module Lucid
|
|
66
66
|
|
67
67
|
step_invocation.instance_variable_get('@multiline_arg').to_step_definition_arg.should == 'status_passing type_regression'
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
end
|
71
71
|
end
|
72
|
-
end
|
72
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
module Lucid::AST
|
4
|
-
|
5
|
-
describe
|
4
|
+
|
5
|
+
describe Walker do
|
6
6
|
let(:tdl_walker) do
|
7
|
-
|
7
|
+
Walker.new(nil, [double('listener', :before_visit_features => nil)])
|
8
8
|
end
|
9
9
|
let(:features) { double('features', :accept => nil) }
|
10
10
|
|
@@ -17,5 +17,5 @@ module Lucid::AST
|
|
17
17
|
tdl_walker.visit_features(features).should == tdl_walker
|
18
18
|
end
|
19
19
|
end
|
20
|
-
|
21
|
-
end
|
20
|
+
|
21
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
module Lucid
|
4
|
-
describe
|
4
|
+
describe Context do
|
5
5
|
describe '.default' do
|
6
|
-
subject {
|
6
|
+
subject { Context.default }
|
7
7
|
|
8
8
|
it 'has an autoload_code_paths containing default Lucid folders' do
|
9
9
|
subject.autoload_code_paths.should include 'common'
|
@@ -14,33 +14,33 @@ module Lucid
|
|
14
14
|
|
15
15
|
describe 'supports custom user options' do
|
16
16
|
let(:user_options) { { :autoload_code_paths => ['library/common'] } }
|
17
|
-
subject {
|
17
|
+
subject { Context.new(user_options) }
|
18
18
|
|
19
19
|
it 'should allow the defaults to be overridden' do
|
20
20
|
subject.autoload_code_paths.should == ['library/common']
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
module CLI
|
26
|
-
describe
|
26
|
+
describe Context do
|
27
27
|
|
28
28
|
attr_reader :out, :error
|
29
|
-
|
29
|
+
|
30
30
|
module ExposeOptions
|
31
31
|
attr_reader :options
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def config
|
35
|
-
@config ||=
|
35
|
+
@config ||= Context.new(@out = StringIO.new, @error = StringIO.new).extend(ExposeOptions)
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def with_these_files(*files)
|
39
39
|
File.stub(:directory?).and_return(true)
|
40
40
|
File.stub(:file?).and_return(true)
|
41
41
|
Dir.stub(:[]).and_return(files)
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
def with_this_configuration(info)
|
45
45
|
Dir.stub(:glob).with('{,.config/,config/}lucid{.yml,.yaml}').and_return(['lucid.yml'])
|
46
46
|
File.stub(:exist?).and_return(true)
|
@@ -50,27 +50,27 @@ module Lucid
|
|
50
50
|
|
51
51
|
it 'should require driver.rb files first' do
|
52
52
|
with_these_files('/common/support/browser.rb', '/common/support/driver.rb')
|
53
|
-
config.
|
54
|
-
|
53
|
+
config.parse_options(%w{--require /common})
|
54
|
+
|
55
55
|
config.library_context.should == %w(
|
56
56
|
/common/support/driver.rb
|
57
57
|
/common/support/browser.rb
|
58
58
|
)
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
it 'should not require driver.rb files when a dry run is attempted' do
|
62
62
|
with_these_files('/common/support/browser.rb', '/common/support/driver.rb')
|
63
|
-
config.
|
63
|
+
config.parse_options(%w{--require /common --dry-run})
|
64
64
|
|
65
65
|
config.library_context.should == %w(
|
66
66
|
/common/support/browser.rb
|
67
67
|
)
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
it 'should require files in default definition locations' do
|
71
71
|
with_these_files('/pages/page.rb', '/steps/steps.rb')
|
72
|
-
config.
|
73
|
-
|
72
|
+
config.parse_options(%w{--require /specs})
|
73
|
+
|
74
74
|
config.definition_context.should == %w(
|
75
75
|
/pages/page.rb
|
76
76
|
/steps/steps.rb
|
@@ -82,17 +82,17 @@ module Lucid
|
|
82
82
|
Dir.stub(:[]).with('specs/**/*.spec').and_return(['lucid.spec'])
|
83
83
|
Dir.stub(:[]).with('specs/**/*.feature').and_return(['lucid.spec'])
|
84
84
|
Dir.stub(:[]).with('specs/**/*.story').and_return(['lucid.spec'])
|
85
|
-
config.
|
86
|
-
config.
|
85
|
+
config.parse_options(%w{})
|
86
|
+
config.spec_context.should == ['lucid.spec']
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
89
|
it 'should search for all specs in the specified directory' do
|
90
90
|
File.stub(:directory?).and_return(true)
|
91
91
|
Dir.stub(:[]).with('specs/**/*.spec').and_return(['lucid.spec'])
|
92
92
|
Dir.stub(:[]).with('specs/**/*.feature').and_return(['lucid.spec'])
|
93
93
|
Dir.stub(:[]).with('specs/**/*.story').and_return(['lucid.spec'])
|
94
|
-
config.
|
95
|
-
config.
|
94
|
+
config.parse_options(%w{specs/})
|
95
|
+
config.spec_context.should == ['lucid.spec']
|
96
96
|
end
|
97
97
|
|
98
98
|
it 'should return the correct spec file type for feature file' do
|
@@ -100,8 +100,8 @@ module Lucid
|
|
100
100
|
Dir.stub(:[]).with('specs/**/*.spec').and_return(['lucid.feature'])
|
101
101
|
Dir.stub(:[]).with('specs/**/*.feature').and_return(['lucid.feature'])
|
102
102
|
Dir.stub(:[]).with('specs/**/*.story').and_return(['lucid.feature'])
|
103
|
-
config.
|
104
|
-
config.
|
103
|
+
config.parse_options(%w{specs/})
|
104
|
+
config.spec_context.should == ['lucid.feature']
|
105
105
|
end
|
106
106
|
|
107
107
|
it 'should return the correct spec file type for story file' do
|
@@ -109,27 +109,27 @@ module Lucid
|
|
109
109
|
Dir.stub(:[]).with('specs/**/*.spec').and_return(['lucid.story'])
|
110
110
|
Dir.stub(:[]).with('specs/**/*.feature').and_return(['lucid.story'])
|
111
111
|
Dir.stub(:[]).with('specs/**/*.story').and_return(['lucid.story'])
|
112
|
-
config.
|
113
|
-
config.
|
112
|
+
config.parse_options(%w{specs/})
|
113
|
+
config.spec_context.should == ['lucid.story']
|
114
114
|
end
|
115
115
|
|
116
116
|
it 'should preserve the order of the spec files' do
|
117
|
-
config.
|
118
|
-
config.
|
117
|
+
config.parse_options(%w{test_b.spec test_c.spec test_a.spec})
|
118
|
+
config.spec_context.should == %w[test_b.spec test_c.spec test_a.spec]
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
it 'should be able to exclude files based on a specific reference' do
|
122
122
|
with_these_files('/common/support/browser.rb', '/common/support/driver.rb')
|
123
|
-
config.
|
124
|
-
|
123
|
+
config.parse_options(%w{--require /common --exclude browser.rb})
|
124
|
+
|
125
125
|
config.spec_requires.should == %w(
|
126
126
|
/common/support/driver.rb
|
127
127
|
)
|
128
128
|
end
|
129
|
-
|
129
|
+
|
130
130
|
it 'should be able to exclude files based on a general pattern' do
|
131
131
|
with_these_files('/steps/tester.rb', '/steps/tested.rb', '/steps/testing.rb', '/steps/quality.rb')
|
132
|
-
config.
|
132
|
+
config.parse_options(%w{--require /steps --exclude test(er|ed) --exclude quality})
|
133
133
|
|
134
134
|
config.spec_requires.should == %w(
|
135
135
|
/steps/testing.rb
|
@@ -137,114 +137,114 @@ module Lucid
|
|
137
137
|
end
|
138
138
|
|
139
139
|
it 'should allow specifying environment variables on the command line' do
|
140
|
-
config.
|
140
|
+
config.parse_options(['test=this'])
|
141
141
|
ENV['test'].should == 'this'
|
142
|
-
config.
|
142
|
+
config.spec_context.should_not include('test=this')
|
143
143
|
end
|
144
|
-
|
144
|
+
|
145
145
|
it 'should be able to use a --dry-run option' do
|
146
|
-
config.
|
146
|
+
config.parse_options(%w{--dry-run})
|
147
147
|
config.options[:dry_run].should be_true
|
148
148
|
end
|
149
|
-
|
149
|
+
|
150
150
|
it 'should be able to use a --no-source option' do
|
151
|
-
config.
|
151
|
+
config.parse_options(%w{--no-source})
|
152
152
|
config.options[:source].should be_false
|
153
153
|
end
|
154
|
-
|
154
|
+
|
155
155
|
it 'should be able to use a --no-matchers option' do
|
156
|
-
config.
|
156
|
+
config.parse_options(%w{--no-matchers})
|
157
157
|
config.options[:matchers].should be_false
|
158
158
|
end
|
159
|
-
|
159
|
+
|
160
160
|
it 'should be able to use a --quiet option' do
|
161
|
-
config.
|
161
|
+
config.parse_options(%w{--quiet})
|
162
162
|
config.options[:source].should be_false
|
163
163
|
config.options[:matchers].should be_false
|
164
164
|
end
|
165
|
-
|
165
|
+
|
166
166
|
it 'should be able to use a --verbose option' do
|
167
|
-
config.
|
167
|
+
config.parse_options(%w{--verbose})
|
168
168
|
config.options[:verbose].should be_true
|
169
169
|
end
|
170
170
|
|
171
171
|
it 'uses the default profile when no profile is defined' do
|
172
172
|
with_this_configuration({'default' => '--require test_file'})
|
173
|
-
config.
|
173
|
+
config.parse_options(%w{--format progress})
|
174
174
|
config.options[:require].should include('test_file')
|
175
175
|
end
|
176
|
-
|
176
|
+
|
177
177
|
describe 'generating output' do
|
178
|
-
|
178
|
+
|
179
179
|
it 'should be able to use an --out option' do
|
180
|
-
config.
|
180
|
+
config.parse_options(%w{--out report.txt})
|
181
181
|
config.formats.should == [%w(standard report.txt)]
|
182
182
|
end
|
183
|
-
|
183
|
+
|
184
184
|
it 'should be able to use multiple --out options' do
|
185
|
-
config.
|
185
|
+
config.parse_options(%w{--format standard --out report1.txt --out report2.txt})
|
186
186
|
config.formats.should == [%w(standard report2.txt)]
|
187
187
|
end
|
188
|
-
|
188
|
+
|
189
189
|
end
|
190
190
|
|
191
191
|
it 'should be able to use a --color option' do
|
192
192
|
Lucid::Term::ANSIColor.should_receive(:coloring=).with(true)
|
193
|
-
config.
|
193
|
+
config.parse_options(['--color'])
|
194
194
|
end
|
195
195
|
|
196
196
|
it 'should accept --no-color option' do
|
197
197
|
Lucid::Term::ANSIColor.should_receive(:coloring=).with(false)
|
198
|
-
config =
|
199
|
-
config.
|
198
|
+
config = Context.new(StringIO.new)
|
199
|
+
config.parse_options(['--no-color'])
|
200
200
|
end
|
201
201
|
|
202
202
|
it 'should accept multiple --format options and put the STDOUT one first so progress is seen' do
|
203
|
-
config.
|
203
|
+
config.parse_options(%w{--format standard --out output.txt --format progress})
|
204
204
|
config.formats.should == [['progress', out], ['standard', 'output.txt']]
|
205
205
|
end
|
206
206
|
|
207
207
|
it 'should not accept multiple --format options when both use implicit STDOUT' do
|
208
208
|
lambda do
|
209
|
-
config.
|
209
|
+
config.parse_options(%w{--format pretty --format progress})
|
210
210
|
end.should raise_error('All but one formatter must use --out, only one can print to each stream (or STDOUT)')
|
211
211
|
end
|
212
212
|
|
213
213
|
it 'should accept same --format options with implicit STDOUT, and keep only one' do
|
214
|
-
config.
|
214
|
+
config.parse_options(%w{--format standard --format standard})
|
215
215
|
config.formats.should == [['standard', out]]
|
216
216
|
end
|
217
217
|
|
218
218
|
it 'should not accept multiple --out streams pointing to the same place' do
|
219
219
|
lambda do
|
220
|
-
config.
|
220
|
+
config.parse_options(%w{--format standard --out file1 --format progress --out file1})
|
221
221
|
end.should raise_error('All but one formatter must use --out, only one can print to each stream (or STDOUT)')
|
222
222
|
end
|
223
223
|
|
224
224
|
it 'should associate --out to previous --format' do
|
225
|
-
config.
|
225
|
+
config.parse_options(%w{--format progress --out file1 --format profile --out file2})
|
226
226
|
config.formats.should == [['progress', 'file1'], ['profile', 'file2']]
|
227
227
|
end
|
228
228
|
|
229
229
|
it 'should accept same --format options with same --out streams and keep only one' do
|
230
|
-
config.
|
230
|
+
config.parse_options(%w{--format html --out file --format standard --format html --out file})
|
231
231
|
config.formats.should == [['standard', out], ['html', 'file']]
|
232
232
|
end
|
233
233
|
|
234
234
|
it 'should accept same --format options with different --out streams' do
|
235
|
-
config.
|
235
|
+
config.parse_options(%w{--format html --out file1 --format html --out file2})
|
236
236
|
config.formats.should == [['html', 'file1'], ['html', 'file2']]
|
237
237
|
end
|
238
238
|
|
239
239
|
it 'should accept multiple --name options' do
|
240
|
-
config.
|
240
|
+
config.parse_options(['--name', 'User logs in', '--name', 'User signs up'])
|
241
241
|
|
242
242
|
config.options[:name_regexps].should include(/User logs in/)
|
243
243
|
config.options[:name_regexps].should include(/User signs up/)
|
244
244
|
end
|
245
245
|
|
246
246
|
it 'should accept multiple -n options' do
|
247
|
-
config.
|
247
|
+
config.parse_options(['-n', 'User logs in', '-n', 'User signs up'])
|
248
248
|
|
249
249
|
config.options[:name_regexps].should include(/User logs in/)
|
250
250
|
config.options[:name_regexps].should include(/User signs up/)
|
@@ -252,54 +252,54 @@ module Lucid
|
|
252
252
|
|
253
253
|
it 'should allow specifying environment variables in profiles' do
|
254
254
|
with_this_configuration({'selenium' => 'DRIVER=selenium'})
|
255
|
-
config.
|
255
|
+
config.parse_options(['--profile', 'selenium'])
|
256
256
|
ENV['DRIVER'].should == 'selenium'
|
257
|
-
config.
|
257
|
+
config.spec_context.should_not include('DRIVER=selenium')
|
258
258
|
end
|
259
259
|
|
260
260
|
describe 'Dry run execution' do
|
261
261
|
it 'returns true when --dry-run was specified on in the arguments' do
|
262
|
-
config.
|
262
|
+
config.parse_options(['--dry-run'])
|
263
263
|
config.dry_run?.should be_true
|
264
264
|
end
|
265
265
|
|
266
266
|
it 'returns true when --dry-run was specified in a profile' do
|
267
267
|
with_this_configuration({'default' => '--dry-run'})
|
268
|
-
config.
|
268
|
+
config.parse_options([])
|
269
269
|
config.dry_run?.should be_true
|
270
270
|
end
|
271
271
|
|
272
272
|
it 'returns false by default' do
|
273
|
-
config.
|
273
|
+
config.parse_options([])
|
274
274
|
config.dry_run?.should be_false
|
275
275
|
end
|
276
276
|
end
|
277
|
-
|
277
|
+
|
278
278
|
describe 'Specifying matcher type' do
|
279
279
|
it 'returns the matcher type when it was set' do
|
280
|
-
config.
|
280
|
+
config.parse_options(['--matcher-type', 'classic'])
|
281
281
|
config.matcher_type.should eql :classic
|
282
282
|
end
|
283
283
|
|
284
284
|
it 'returns the matcher type when it was set with shorthand option' do
|
285
|
-
config.
|
285
|
+
config.parse_options(['-I', 'classic'])
|
286
286
|
config.matcher_type.should eql :classic
|
287
287
|
end
|
288
288
|
|
289
289
|
it 'returns the default matcher type if it was not set' do
|
290
|
-
config.
|
290
|
+
config.parse_options([])
|
291
291
|
config.matcher_type.should eql :regexp
|
292
292
|
end
|
293
293
|
end
|
294
294
|
|
295
295
|
describe 'handling tags' do
|
296
296
|
it 'returns an empty expression when no tags are specified' do
|
297
|
-
config.
|
297
|
+
config.parse_options([])
|
298
298
|
config.tag_expression.should be_empty
|
299
299
|
end
|
300
300
|
|
301
301
|
it 'returns an expression when tags are specified' do
|
302
|
-
config.
|
302
|
+
config.parse_options(['--tags','@smoke'])
|
303
303
|
config.tag_expression.should_not be_empty
|
304
304
|
end
|
305
305
|
end
|
@@ -317,12 +317,12 @@ module Lucid
|
|
317
317
|
e.backtrace[0].should_not == "#{__FILE__}:#{__LINE__ - 2}"
|
318
318
|
end
|
319
319
|
end
|
320
|
-
|
320
|
+
|
321
321
|
after do
|
322
322
|
Lucid.use_full_backtrace = false
|
323
323
|
end
|
324
324
|
end
|
325
|
-
|
325
|
+
|
326
326
|
end
|
327
327
|
end
|
328
|
-
end
|
328
|
+
end
|