cucumber-in-the-yard 1.3 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +24 -0
- data/Manifest +54 -41
- data/README.md +45 -1
- data/Rakefile +4 -3
- data/cucumber-in-the-yard.gemspec +5 -5
- data/example/{example.step.rb → step_definitions/example.step.rb} +0 -0
- data/example/step_definitions/support/env.rb +0 -0
- data/example/step_definitions/support/env_support.rb +0 -0
- data/example/step_definitions/support/support.rb +0 -0
- data/features/definitions/city_step.rb +89 -0
- data/features/definitions/test.setup.and.teardown.rb +27 -0
- data/features/features.feature +44 -0
- data/lib/city.rb +20 -11
- data/lib/cucumber/city_builder.rb +60 -55
- data/lib/templates/default/feature/html/background.erb +92 -0
- data/lib/templates/default/feature/html/feature.erb +22 -0
- data/lib/templates/default/feature/html/no_steps_defined.erb +1 -0
- data/lib/templates/default/feature/html/outline.erb +19 -0
- data/lib/templates/default/feature/html/pystring.erb +3 -0
- data/lib/templates/default/feature/html/scenario.erb +43 -0
- data/lib/templates/default/feature/html/steps.erb +34 -0
- data/lib/templates/default/feature/html/table.erb +20 -0
- data/lib/templates/default/feature/setup.rb +28 -0
- data/lib/{yard/templates → templates}/default/fulldoc/html/css/common.css +0 -0
- data/lib/{yard/templates → templates}/default/fulldoc/html/full_list.erb +0 -0
- data/lib/templates/default/fulldoc/html/full_list_features.erb +7 -0
- data/lib/templates/default/fulldoc/html/full_list_requirements.erb +1 -0
- data/lib/templates/default/fulldoc/html/full_list_scenarios.erb +8 -0
- data/lib/{yard/templates → templates}/default/fulldoc/html/full_list_stepdefinitions.erb +2 -2
- data/lib/{yard/templates → templates}/default/fulldoc/html/full_list_steps.erb +0 -0
- data/lib/templates/default/fulldoc/html/full_list_tags.erb +8 -0
- data/lib/{yard/templates → templates}/default/fulldoc/html/index.erb +0 -0
- data/lib/{yard/templates → templates}/default/fulldoc/html/js/cucumber.js +1 -1
- data/lib/templates/default/fulldoc/html/setup.rb +56 -0
- data/lib/{yard/templates → templates}/default/layout/html/headers.erb +0 -0
- data/lib/{yard/templates → templates}/default/layout/html/search.erb +0 -0
- data/lib/{yard/templates → templates}/default/scenario/html/scenario.erb +0 -0
- data/lib/{yard/templates → templates}/default/scenario/setup.rb +0 -0
- data/lib/templates/default/steptransformers/html/stepdefinition.erb +38 -0
- data/lib/templates/default/steptransformers/html/steptransformers.erb +7 -0
- data/lib/templates/default/steptransformers/setup.rb +17 -0
- data/lib/templates/default/tag/html/feature.erb +23 -0
- data/lib/templates/default/tag/html/scenario.erb +21 -0
- data/lib/templates/default/tag/html/tag.erb +18 -0
- data/lib/templates/default/tag/setup.rb +5 -0
- data/lib/yard/code_objects/{base.rb → cucumber/base.rb} +3 -9
- data/lib/yard/code_objects/{feature.rb → cucumber/feature.rb} +1 -1
- data/lib/yard/code_objects/cucumber/namespace_object.rb +18 -0
- data/lib/yard/code_objects/{scenario.rb → cucumber/scenario.rb} +1 -1
- data/lib/yard/code_objects/{step.rb → cucumber/step.rb} +0 -0
- data/lib/yard/code_objects/cucumber/tag.rb +27 -0
- data/lib/yard/{extensions.rb → code_objects/namespace_object.rb} +11 -2
- data/lib/yard/code_objects/step_definition.rb +38 -0
- data/lib/yard/code_objects/step_transform.rb +14 -0
- data/lib/yard/handlers/{base.rb → cucumber/base.rb} +0 -0
- data/lib/yard/handlers/{feature_handler.rb → cucumber/feature_handler.rb} +3 -2
- data/lib/yard/handlers/step_definition_handler.rb +57 -0
- data/lib/yard/handlers/step_transform_handler.rb +21 -0
- data/lib/yard/parser/{feature.rb → cucumber/feature.rb} +0 -0
- data/lib/yard/parser/source_parser.rb +54 -0
- data/lib/yard/rake/city_task.rb +1 -1
- data/lib/yard/templates/helpers/base_helper.rb +20 -0
- metadata +105 -77
- data/lib/yard/code_objects/tags.rb +0 -55
- data/lib/yard/rb_extensions.rb +0 -156
- data/lib/yard/templates/default/feature/html/feature.erb +0 -245
- data/lib/yard/templates/default/feature/setup.rb +0 -5
- data/lib/yard/templates/default/fulldoc/html/full_list_features.erb +0 -10
- data/lib/yard/templates/default/fulldoc/html/full_list_scenarios.erb +0 -10
- data/lib/yard/templates/default/fulldoc/html/full_list_tagusages.erb +0 -10
- data/lib/yard/templates/default/fulldoc/html/setup.rb +0 -73
- data/lib/yard/templates/default/module/html/step_transforms.erb +0 -23
- data/lib/yard/templates/default/module/setup.rb +0 -5
- data/lib/yard/templates/default/steptransformers/html/stepdefinition.erb +0 -50
- data/lib/yard/templates/default/steptransformers/setup.rb +0 -5
- data/lib/yard/templates/default/tagusage/html/tagusage.erb +0 -65
- data/lib/yard/templates/default/tagusage/setup.rb +0 -5
- data/spec/city/feature_parser_spec_examples.rb +0 -153
- data/spec/city/gherkin_loader_spec.rb +0 -39
- data/spec/city/test.feature +0 -36
- data/spec/city/yard_handlers_cucumber_spec.rb +0 -24
- data/spec/city/yard_namespace_object_spec.rb +0 -8
- data/spec/city/yard_parser_cucumber_spec.rb +0 -215
- data/spec/city/yard_rb_extensions_spec.rb +0 -128
- data/spec/spec_helper.rb +0 -5
@@ -1,128 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
module YARD::CodeObjects
|
4
|
-
|
5
|
-
describe YARD::CodeObjects do
|
6
|
-
|
7
|
-
shared_examples_for "CodeObjects" do
|
8
|
-
it "should respond to all defined attributes" do
|
9
|
-
@attributes.each {|attribute| @object.should respond_to(attribute) }
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe StepDefinitionObject do
|
14
|
-
|
15
|
-
before(:each) do
|
16
|
-
@attributes = [ :value, :keyword, :constants, :compare_value ]
|
17
|
-
@object = StepDefinitionObject.new(:root,:unique_name)
|
18
|
-
end
|
19
|
-
|
20
|
-
class TestObject
|
21
|
-
attr_accessor :name, :value
|
22
|
-
def initialize ; yield self ; end
|
23
|
-
end
|
24
|
-
|
25
|
-
it_should_behave_like "CodeObjects"
|
26
|
-
|
27
|
-
describe "compare_value" do
|
28
|
-
|
29
|
-
[ { :value => "/THERE (?:IS|ARE) THREE \#\{ CONSTANTS \} IN HERE \#\{ FOR\} YOU TO \#\{FIND \}",
|
30
|
-
:results => [ 'CONSTANTS', 'FOR', 'FIND' ] } ].each do |data|
|
31
|
-
|
32
|
-
it "should find all the constants within the step definition" do
|
33
|
-
|
34
|
-
stepdef = StepDefinitionObject.new(:root,"name")
|
35
|
-
stepdef.value = data[:value]
|
36
|
-
|
37
|
-
|
38
|
-
data[:results].each do |result|
|
39
|
-
stepdef._value_constants(data[:value]).should include(result)
|
40
|
-
stepdef._value_constants.should include(result)
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
|
47
|
-
[ { :value => "/WHEN THE \#\{NOUN\} HITS THE FAN/",
|
48
|
-
:constants => [ TestObject.new{|c| c.name = "NOUN" ; c.value = "/SMURF/" } ], :result => "WHEN THE SMURF HITS THE FAN" },
|
49
|
-
|
50
|
-
{ :value => "/\#\{ SUBJECT \} WALK INTO THE \#\{ PLACE\} AND ASK THE \#\{PERSON \}/",
|
51
|
-
:constants => [ TestObject.new{|c| c.name = "SUBJECT" ; c.value = "/1 PERSON/" },
|
52
|
-
TestObject.new{|c| c.name = "PLACE" ; c.value = "/BAR/" },
|
53
|
-
TestObject.new{|c| c.name = "PERSON" ; c.value = "/BARTENDER/" } ],
|
54
|
-
:result => "1 PERSON WALK INTO THE BAR AND ASK THE BARTENDER" },
|
55
|
-
|
56
|
-
].each do |data|
|
57
|
-
|
58
|
-
it "should replace all constants found within (#{data[:value]}) the value" do
|
59
|
-
|
60
|
-
stepdef = StepDefinitionObject.new(:root,"name")
|
61
|
-
stepdef.value = data[:value]
|
62
|
-
stepdef.constants = data[:constants]
|
63
|
-
|
64
|
-
stepdef.compare_value.should == data[:result]
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
|
-
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
end
|
76
|
-
|
77
|
-
describe StepTransformObject do
|
78
|
-
|
79
|
-
before(:each) do
|
80
|
-
@attributes = [ :value ]
|
81
|
-
@object = StepTransformObject.new(:root,:unique_name)
|
82
|
-
end
|
83
|
-
|
84
|
-
it_should_behave_like "CodeObjects"
|
85
|
-
|
86
|
-
end
|
87
|
-
|
88
|
-
end
|
89
|
-
|
90
|
-
end
|
91
|
-
|
92
|
-
module YARD::Handlers::Ruby::Legacy
|
93
|
-
|
94
|
-
describe YARD::Handlers::Ruby::Legacy do
|
95
|
-
|
96
|
-
shared_examples_for "Handlers" do
|
97
|
-
it "should match #{@match_criteria}" do
|
98
|
-
@handler::MATCH.should == @match_criteria
|
99
|
-
end
|
100
|
-
|
101
|
-
it "should respond to the method process" do
|
102
|
-
@handler.should respond_to(:process)
|
103
|
-
end
|
104
|
-
|
105
|
-
end
|
106
|
-
|
107
|
-
describe StepDefinitionHandler do
|
108
|
-
before(:each) do
|
109
|
-
@handler = StepDefinitionHandler
|
110
|
-
@match_criteria = /^((When|Given|And|Then)\s*(\/[^\/]+\/).+)$/
|
111
|
-
end
|
112
|
-
|
113
|
-
it_should_behave_like "Handlers"
|
114
|
-
end
|
115
|
-
|
116
|
-
describe StepTransformHandler do
|
117
|
-
before(:each) do
|
118
|
-
@handler = StepTransformHandler
|
119
|
-
@match_criteria = /^Transform\s*(\/[^\/]+\/).+$/
|
120
|
-
end
|
121
|
-
|
122
|
-
it_should_behave_like "Handlers"
|
123
|
-
end
|
124
|
-
|
125
|
-
|
126
|
-
end
|
127
|
-
|
128
|
-
end
|