lucid 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.md +11 -1
- data/lib/lucid/ast/specs.rb +4 -0
- data/lib/lucid/ast/step.rb +5 -7
- data/lib/lucid/ast/step_invocation.rb +17 -19
- data/lib/lucid/ast/step_result.rb +5 -3
- data/lib/lucid/ast/tdl_walker.rb +0 -124
- data/lib/lucid/formatter/console.rb +3 -3
- data/lib/lucid/platform.rb +1 -1
- metadata +4 -4
data/HISTORY.md
CHANGED
@@ -2,6 +2,16 @@ Change Log and History
|
|
2
2
|
======================
|
3
3
|
|
4
4
|
|
5
|
+
Version 0.0.9 / 2013-05-22
|
6
|
+
--------------------------
|
7
|
+
|
8
|
+
This version is being released to introduce a few more behind-the-scenes logic refactorings and also to fix a specific bug.
|
9
|
+
|
10
|
+
* Lucid was still indicating it could use non-Ruby languages. ([Matchers In Different Languages?](https://github.com/jnyman/lucid/issues/11).)
|
11
|
+
|
12
|
+
As a note, this is the final "patch" version of Lucid prior to going to a semantic versioning approach. Lucid will next enter the initial development phase.
|
13
|
+
|
14
|
+
|
5
15
|
Version 0.0.8 / 2013-05-20
|
6
16
|
--------------------------
|
7
17
|
|
@@ -19,7 +29,7 @@ This version mainly makes a lot of internal changes and many of those are predic
|
|
19
29
|
Two specific changes worth calling out:
|
20
30
|
|
21
31
|
* Lucid will now let you reliably configure a library path.
|
22
|
-
* Lucid will allow you to configure the name of the driver file. (This was due to a [planned enhancement
|
32
|
+
* Lucid will allow you to configure the name of the driver file. (This was due to a [planned enhancement](https://github.com/jnyman/lucid/issues/2)].)
|
23
33
|
|
24
34
|
The driver file in Cucumber is env.rb. In Lucid this defaults to driver.rb. Now, however, you can override that default. Regarding the library path, this is equivalent to what Cucumber refers to as the "support" directory. The main reason for these changes is that Lucid is trying to be a little more configurable than Cucumber.
|
25
35
|
|
data/lib/lucid/ast/specs.rb
CHANGED
@@ -21,6 +21,10 @@ module Lucid
|
|
21
21
|
@features << feature
|
22
22
|
end
|
23
23
|
|
24
|
+
# The ability to visit specs is the first step in turning a spec into
|
25
|
+
# what is traditionally called a feature. The spec file and the feature
|
26
|
+
# are initially the same concept. When the spec is visited, the high
|
27
|
+
# level construct (feature, ability) is determined.
|
24
28
|
def accept(visitor)
|
25
29
|
return if Lucid.wants_to_quit
|
26
30
|
|
data/lib/lucid/ast/step.rb
CHANGED
@@ -51,17 +51,15 @@ module Lucid
|
|
51
51
|
# The only time a Step is visited is when it is in a ScenarioOutline.
|
52
52
|
# Otherwise it's always StepInvocation that gets visited instead.
|
53
53
|
visitor.visit_step(self) do
|
54
|
-
|
54
|
+
status = :skipped
|
55
|
+
exception = nil
|
56
|
+
background = nil
|
57
|
+
step_result = StepResult.new(keyword, first_match(visitor), @multiline_arg, status, exception, source_indent, background, file_colon_line)
|
58
|
+
step_result.accept(visitor)
|
55
59
|
end
|
56
60
|
|
57
61
|
end
|
58
62
|
|
59
|
-
def visit_step_result(visitor, step_match, multiline_arg, status, exception, background)
|
60
|
-
visitor.visit_step_result(
|
61
|
-
StepResult.new(keyword, step_match, @multiline_arg, status, exception, source_indent, background, file_colon_line)
|
62
|
-
)
|
63
|
-
end
|
64
|
-
|
65
63
|
def first_match(visitor)
|
66
64
|
# The feature_element is always a ScenarioOutline in this case.
|
67
65
|
feature_element.each_example_row do |cells|
|
@@ -36,25 +36,10 @@ module Lucid
|
|
36
36
|
|
37
37
|
visitor.visit_step(self) do
|
38
38
|
invoke(visitor.runtime, visitor.configuration)
|
39
|
-
|
39
|
+
step_result.accept(visitor)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
def visit_step_result(visitor)
|
44
|
-
visitor.visit_step_result(
|
45
|
-
StepResult.new(
|
46
|
-
keyword,
|
47
|
-
@step_match,
|
48
|
-
(@different_table || @multiline_arg),
|
49
|
-
@status,
|
50
|
-
@reported_exception,
|
51
|
-
source_indent,
|
52
|
-
@background,
|
53
|
-
file_colon_line
|
54
|
-
)
|
55
|
-
)
|
56
|
-
end
|
57
|
-
|
58
43
|
def invoke(runtime, configuration)
|
59
44
|
find_step_match!(runtime, configuration)
|
60
45
|
unless @skip_invoke || configuration.dry_run? || @exception || @step_collection.exception
|
@@ -147,13 +132,10 @@ module Lucid
|
|
147
132
|
end
|
148
133
|
|
149
134
|
def actual_keyword
|
150
|
-
#repeat_keywords = rubify([language.keywords('but'), language.keywords('and')]).flatten.uniq.reject{|kw| kw == '* '}
|
151
|
-
#if repeat_keywords.index(@step.keyword) && previous
|
152
135
|
keywords = Keywords.new(language)
|
153
136
|
if keywords.repeat_keyword?(keyword) && previous
|
154
137
|
previous.actual_keyword
|
155
138
|
else
|
156
|
-
#keyword == '* ' ? language.code_keywords.first : keyword
|
157
139
|
keyword == '* ' ? keywords.star_code_keyword : keyword
|
158
140
|
end
|
159
141
|
end
|
@@ -222,6 +204,22 @@ module Lucid
|
|
222
204
|
def to_sexp
|
223
205
|
[:step_invocation, @step.line, @step.keyword, @name, (@multiline_arg.nil? ? nil : @multiline_arg.to_sexp)].compact
|
224
206
|
end
|
207
|
+
|
208
|
+
private
|
209
|
+
|
210
|
+
def step_result
|
211
|
+
StepResult.new(
|
212
|
+
keyword,
|
213
|
+
@step_match,
|
214
|
+
(@different_table || @multiline_arg),
|
215
|
+
@status,
|
216
|
+
@reported_exception,
|
217
|
+
source_indent,
|
218
|
+
@background,
|
219
|
+
file_colon_line
|
220
|
+
)
|
221
|
+
end
|
222
|
+
|
225
223
|
end
|
226
224
|
end
|
227
225
|
end
|
@@ -9,9 +9,11 @@ module Lucid
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def accept(visitor)
|
12
|
-
visitor.
|
13
|
-
|
14
|
-
|
12
|
+
visitor.step_result(self) do
|
13
|
+
visitor.visit_step_name(@keyword, @step_match, @status, @source_indent, @background, @file_colon_line)
|
14
|
+
visitor.visit_multiline_arg(@multiline_arg) if @multiline_arg
|
15
|
+
visitor.visit_exception(@exception, @status) if @exception
|
16
|
+
end
|
15
17
|
end
|
16
18
|
|
17
19
|
def args
|
data/lib/lucid/ast/tdl_walker.rb
CHANGED
@@ -15,81 +15,6 @@ module Lucid
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
# The ability to visit specs is the first step in turning a spec into
|
19
|
-
# what is traditionally called a feature. The spec file and the feature
|
20
|
-
# are initially the same concept. When the spec is visited, the high
|
21
|
-
# level construct (feature, ability) is determined.
|
22
|
-
# @see Lucid::Runtime.run
|
23
|
-
#def visit_features(features, &block)
|
24
|
-
# broadcast(features, &block)
|
25
|
-
#end
|
26
|
-
|
27
|
-
#def visit_feature(feature, &block)
|
28
|
-
# broadcast(feature, &block)
|
29
|
-
#end
|
30
|
-
|
31
|
-
#def visit_comment(comment, &block)
|
32
|
-
# broadcast(comment, &block)
|
33
|
-
#end
|
34
|
-
|
35
|
-
#def visit_comment_line(comment_line)
|
36
|
-
# broadcast(comment_line)
|
37
|
-
#end
|
38
|
-
|
39
|
-
#def visit_tags(tags, &block)
|
40
|
-
# broadcast(tags, &block)
|
41
|
-
#end
|
42
|
-
|
43
|
-
#def visit_tag_name(tag_name)
|
44
|
-
# broadcast(tag_name)
|
45
|
-
#end
|
46
|
-
|
47
|
-
#def visit_feature_name(keyword, name)
|
48
|
-
# broadcast(keyword, name)
|
49
|
-
#end
|
50
|
-
|
51
|
-
# Note that a feature_element refers to either a Scenario or
|
52
|
-
# a ScenarioOutline.
|
53
|
-
#def visit_feature_element(feature_element, &block)
|
54
|
-
# broadcast(feature_element, &block)
|
55
|
-
#end
|
56
|
-
|
57
|
-
#def visit_background(background, &block)
|
58
|
-
# broadcast(background, &block)
|
59
|
-
#end
|
60
|
-
|
61
|
-
#def visit_background_name(keyword, name, file_colon_line, source_indent)
|
62
|
-
# broadcast(keyword, name, file_colon_line, source_indent)
|
63
|
-
#end
|
64
|
-
|
65
|
-
#def visit_examples_array(examples_array, &block)
|
66
|
-
# broadcast(examples_array, &block)
|
67
|
-
#end
|
68
|
-
|
69
|
-
#def visit_examples(examples, &block)
|
70
|
-
# broadcast(examples, &block)
|
71
|
-
#end
|
72
|
-
|
73
|
-
#def visit_examples_name(keyword, name)
|
74
|
-
# broadcast(keyword, name)
|
75
|
-
#end
|
76
|
-
|
77
|
-
#def visit_outline_table(outline_table, &block)
|
78
|
-
# broadcast(outline_table, &block)
|
79
|
-
#end
|
80
|
-
|
81
|
-
#def visit_scenario_name(keyword, name, file_colon_line, source_indent)
|
82
|
-
# broadcast(keyword, name, file_colon_line, source_indent)
|
83
|
-
#end
|
84
|
-
|
85
|
-
#def visit_steps(steps, &block)
|
86
|
-
# broadcast(steps, &block)
|
87
|
-
#end
|
88
|
-
|
89
|
-
#def visit_step(step, &block)
|
90
|
-
# broadcast(step, &block)
|
91
|
-
#end
|
92
|
-
|
93
18
|
# This is being used to forward on messages from the AST to
|
94
19
|
# the formatters. This is being done in lieu of the explicit
|
95
20
|
# forwarding that was previously done.
|
@@ -97,61 +22,12 @@ module Lucid
|
|
97
22
|
broadcast_message(message, *args, &block)
|
98
23
|
end
|
99
24
|
|
100
|
-
#def visit_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line)
|
101
|
-
# broadcast(keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line) do
|
102
|
-
# visit_step_name(keyword, step_match, status, source_indent, background, file_colon_line)
|
103
|
-
# visit_multiline_arg(multiline_arg) if multiline_arg
|
104
|
-
# visit_exception(exception, status) if exception
|
105
|
-
# end
|
106
|
-
#end
|
107
|
-
|
108
|
-
def visit_step_result(step_result)
|
109
|
-
broadcast(step_result) do
|
110
|
-
step_result.accept(self)
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
#def visit_step_name(keyword, step_match, status, source_indent, background, file_colon_line) #:nodoc:
|
115
|
-
# broadcast(keyword, step_match, status, source_indent, background, file_colon_line)
|
116
|
-
#end
|
117
|
-
|
118
25
|
def visit_multiline_arg(multiline_arg) #:nodoc:
|
119
26
|
broadcast(multiline_arg) do
|
120
27
|
multiline_arg.accept(self)
|
121
28
|
end
|
122
29
|
end
|
123
30
|
|
124
|
-
#def visit_exception(exception, status) #:nodoc:
|
125
|
-
# broadcast(exception, status)
|
126
|
-
#end
|
127
|
-
|
128
|
-
#def visit_doc_string(string)
|
129
|
-
# broadcast(string)
|
130
|
-
#end
|
131
|
-
|
132
|
-
#def visit_table_row(table_row, &block)
|
133
|
-
# broadcast(table_row, &block)
|
134
|
-
#end
|
135
|
-
|
136
|
-
#def visit_table_cell(table_cell, &block)
|
137
|
-
# broadcast(table_cell, &block)
|
138
|
-
#end
|
139
|
-
|
140
|
-
#def visit_table_cell_value(value, status)
|
141
|
-
# broadcast(value, status)
|
142
|
-
#end
|
143
|
-
|
144
|
-
# Print +messages+. This method can be called from within StepDefinitions.
|
145
|
-
def puts(*messages)
|
146
|
-
broadcast(*messages)
|
147
|
-
end
|
148
|
-
|
149
|
-
# Embed +file+ of +mime_type+ in the formatter. This method can be called from within StepDefinitions.
|
150
|
-
# For most formatters this is a no-op.
|
151
|
-
def embed(file, mime_type, label)
|
152
|
-
broadcast(file, mime_type, label)
|
153
|
-
end
|
154
|
-
|
155
31
|
private
|
156
32
|
|
157
33
|
def broadcast(*args, &block)
|
@@ -131,9 +131,9 @@ module Lucid
|
|
131
131
|
@io.puts format_string(text, :undefined)
|
132
132
|
|
133
133
|
if unknown_programming_language
|
134
|
-
@io.puts format_string("\
|
135
|
-
"\
|
136
|
-
"\
|
134
|
+
@io.puts format_string("\nNote: no test definitions were found in this repository or any" +
|
135
|
+
"\nother associated locations. These test definition files should" +
|
136
|
+
"\nbe where you put any of the suggested matchers.", :failed)
|
137
137
|
end
|
138
138
|
|
139
139
|
@io.puts
|
data/lib/lucid/platform.rb
CHANGED
@@ -2,7 +2,7 @@ require 'rbconfig'
|
|
2
2
|
|
3
3
|
module Lucid
|
4
4
|
unless defined?(Lucid::VERSION)
|
5
|
-
VERSION = '0.0.
|
5
|
+
VERSION = '0.0.9'
|
6
6
|
BINARY = File.expand_path(File.dirname(__FILE__) + '/../../bin/lucid')
|
7
7
|
LIBDIR = File.expand_path(File.dirname(__FILE__) + '/../../lib')
|
8
8
|
JRUBY = defined?(JRUBY_VERSION)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -260,7 +260,7 @@ homepage: https://github.com/jnyman/lucid
|
|
260
260
|
licenses:
|
261
261
|
- MIT
|
262
262
|
post_install_message: ! "\n(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
|
263
|
-
(::)\n\n Thanks for installing Lucid 0.0.
|
263
|
+
(::)\n\n Thanks for installing Lucid 0.0.9.\n\n(::) (::) (::) (::) (::) (::) (::)
|
264
264
|
(::) (::) (::) (::) (::)\n "
|
265
265
|
rdoc_options:
|
266
266
|
- --charset=UTF-8
|
@@ -283,6 +283,6 @@ rubyforge_project:
|
|
283
283
|
rubygems_version: 1.8.24
|
284
284
|
signing_key:
|
285
285
|
specification_version: 3
|
286
|
-
summary: lucid-0.0.
|
286
|
+
summary: lucid-0.0.9
|
287
287
|
test_files: []
|
288
288
|
has_rdoc:
|