lucid 0.4.1 → 0.5.1
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/Gemfile +0 -3
- data/HISTORY.md +12 -0
- data/LICENSE +0 -3
- data/README.md +7 -5
- data/Rakefile +0 -14
- data/lib/lucid.rb +4 -0
- data/lib/lucid/cli/app.rb +1 -5
- data/lib/lucid/cli/context.rb +8 -6
- data/lib/lucid/cli/profile.rb +9 -9
- data/lib/lucid/context.rb +1 -1
- data/lib/lucid/interface_rb/matcher.rb +1 -2
- data/lib/lucid/platform.rb +2 -1
- data/lucid.gemspec +12 -12
- data/spec/lucid/lucid_spec.rb +7 -0
- data/spec/spec_helper.rb +0 -19
- metadata +34 -116
- data/.travis.yml +0 -15
- data/lib/lucid/sequence.rb +0 -5
- data/lib/lucid/sequence/sequence_errors.rb +0 -64
- data/lib/lucid/sequence/sequence_group.rb +0 -35
- data/lib/lucid/sequence/sequence_phrase.rb +0 -166
- data/lib/lucid/sequence/sequence_steps.rb +0 -20
- data/lib/lucid/sequence/sequence_support.rb +0 -26
- data/lib/lucid/sequence/sequence_template.rb +0 -354
- data/spec/lucid/ansicolor_spec.rb +0 -31
- data/spec/lucid/app_spec.rb +0 -82
- data/spec/lucid/ast/background_spec.rb +0 -128
- data/spec/lucid/ast/doc_string_spec.rb +0 -36
- data/spec/lucid/ast/feature_spec.rb +0 -66
- data/spec/lucid/ast/outline_table_spec.rb +0 -21
- data/spec/lucid/ast/scenario_outline_spec.rb +0 -81
- data/spec/lucid/ast/specs_spec.rb +0 -48
- data/spec/lucid/ast/step_invocation_spec.rb +0 -45
- data/spec/lucid/ast/step_spec.rb +0 -72
- data/spec/lucid/ast/table_spec.rb +0 -265
- data/spec/lucid/ast/tdl_factory.rb +0 -78
- data/spec/lucid/ast/tdl_walker_spec.rb +0 -21
- data/spec/lucid/context_spec.rb +0 -328
- data/spec/lucid/duration_spec.rb +0 -22
- data/spec/lucid/facade_spec.rb +0 -31
- data/spec/lucid/factory_spec.rb +0 -16
- data/spec/lucid/matcher_spec.rb +0 -127
- data/spec/lucid/options_spec.rb +0 -346
- data/spec/lucid/orchestrator_spec.rb +0 -117
- data/spec/lucid/pending_spec.rb +0 -45
- data/spec/lucid/progress_spec.rb +0 -34
- data/spec/lucid/rb_step_definition_spec.rb +0 -127
- data/spec/lucid/rb_transform_spec.rb +0 -24
- data/spec/lucid/regexp_argument_matcher_spec.rb +0 -19
- data/spec/lucid/results_spec.rb +0 -81
- data/spec/lucid/runtime_spec.rb +0 -38
- data/spec/lucid/sequences/sequence_conditional_spec.rb +0 -74
- data/spec/lucid/sequences/sequence_group_spec.rb +0 -55
- data/spec/lucid/sequences/sequence_phrase_spec.rb +0 -122
- data/spec/lucid/sequences/sequence_placeholder_spec.rb +0 -56
- data/spec/lucid/sequences/sequence_section_spec.rb +0 -61
- data/spec/lucid/sequences/sequence_support_spec.rb +0 -65
- data/spec/lucid/sequences/sequence_template_spec.rb +0 -298
- data/spec/lucid/step_match_spec.rb +0 -55
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
require 'lucid/interface_rb/rb_language'
|
4
|
-
require 'lucid/interface_rb/rb_step_definition'
|
5
|
-
|
6
|
-
module Lucid
|
7
|
-
describe StepMatch do
|
8
|
-
|
9
|
-
WORD = '[[:word:]]'
|
10
|
-
|
11
|
-
before do
|
12
|
-
@rb_code = InterfaceRb::RbLanguage.new(nil)
|
13
|
-
end
|
14
|
-
|
15
|
-
def testdef(regexp)
|
16
|
-
InterfaceRb::RbStepDefinition.new(@rb_code, regexp, lambda{}, {})
|
17
|
-
end
|
18
|
-
|
19
|
-
def step_match(regexp, name)
|
20
|
-
testdef = testdef(regexp)
|
21
|
-
StepMatch.new(testdef, name, nil, testdef.arguments_from(name))
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'should format groups with format string' do
|
25
|
-
result = step_match(/Lucid (#{WORD}+) (\d+) (#{WORD}+) this (#{WORD}+)/, 'Lucid parsed 10 tests this build')
|
26
|
-
result.format_args('<span>%s</span>').should == 'Lucid <span>parsed</span> <span>10</span> <span>tests</span> this <span>build</span>'
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'should format groups with format string when there are duplications' do
|
30
|
-
result = step_match(/Lucid (#{WORD}+) (\d+) (#{WORD}+) this (#{WORD}+)/, 'Lucid testing 1 tester this test')
|
31
|
-
result.format_args('<span>%s</span>').should == 'Lucid <span>testing</span> <span>1</span> <span>tester</span> this <span>test</span>'
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'should format groups with block' do
|
35
|
-
result = step_match(/Lucid (#{WORD}+) (\d+) (#{WORD}+) this (#{WORD}+)/, 'Lucid parsed 1 test this build')
|
36
|
-
result.format_args(&lambda{|m| "<span>#{m}</span>"}).should == 'Lucid <span>parsed</span> <span>1</span> <span>test</span> this <span>build</span>'
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'should format groups with proc object' do
|
40
|
-
result = step_match(/Lucid (#{WORD}+) (\d+) (#{WORD}+) this (#{WORD}+)/, 'Lucid parsed 1 test this build')
|
41
|
-
result.format_args(lambda{|m| "<span>#{m}</span>"}).should == 'Lucid <span>parsed</span> <span>1</span> <span>test</span> this <span>build</span>'
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'should format groups even when the first group is optional and not matched' do
|
45
|
-
result = step_match(/should( not)? show message '([^']*?)'$/, "App should show message 'Login failed.'")
|
46
|
-
result.format_args('<span>%s</span>').should == "App should show message '<span>Login failed.</span>'"
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'should format embedded groups' do
|
50
|
-
result = step_match(/running( (\d+) scenarios)? (\d+) tests/, 'running 5 scenarios 10 tests')
|
51
|
-
result.format_args('<span>%s</span>').should == 'running<span> 5 scenarios</span> <span>10</span> tests'
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
55
|
-
end
|