cuke_modeler 0.3.0 → 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.rdoc +8 -0
- data/features/step_definitions/feature_steps.rb +1 -1
- data/features/step_definitions/test_steps.rb +6 -2
- data/lib/cuke_modeler/directory.rb +7 -10
- data/lib/cuke_modeler/version.rb +1 -1
- data/spec/integration/background_integration_spec.rb +53 -40
- data/spec/integration/directory_integration_spec.rb +39 -26
- data/spec/integration/doc_string_integration_spec.rb +51 -43
- data/spec/integration/example_integration_spec.rb +71 -60
- data/spec/integration/feature_file_integration_spec.rb +36 -22
- data/spec/integration/feature_integration_spec.rb +113 -104
- data/spec/integration/outline_integration_spec.rb +71 -56
- data/spec/integration/row_integration_spec.rb +72 -0
- data/spec/integration/scenario_integration_spec.rb +61 -46
- data/spec/integration/step_integration_spec.rb +126 -117
- data/spec/integration/table_integration_spec.rb +67 -52
- data/spec/integration/table_row_integration_spec.rb +48 -40
- data/spec/integration/tag_integration_spec.rb +53 -45
- data/spec/integration/world_integration_spec.rb +2 -1
- data/spec/spec_helper.rb +15 -12
- data/spec/unit/background_unit_spec.rb +65 -50
- data/spec/unit/bare_bones_unit_specs.rb +2 -3
- data/spec/unit/containing_element_unit_specs.rb +6 -7
- data/spec/unit/directory_unit_spec.rb +103 -64
- data/spec/unit/doc_string_unit_spec.rb +113 -95
- data/spec/unit/example_unit_spec.rb +235 -219
- data/spec/unit/feature_element_unit_spec.rb +6 -6
- data/spec/unit/feature_element_unit_specs.rb +28 -24
- data/spec/unit/feature_file_unit_spec.rb +73 -63
- data/spec/unit/feature_unit_spec.rb +145 -111
- data/spec/unit/nested_element_unit_specs.rb +14 -13
- data/spec/unit/nested_unit_spec.rb +24 -21
- data/spec/unit/outline_unit_spec.rb +92 -78
- data/spec/unit/parsing_unit_spec.rb +55 -51
- data/spec/unit/prepopulated_unit_specs.rb +2 -3
- data/spec/unit/raw_element_unit_specs.rb +12 -11
- data/spec/unit/raw_unit_spec.rb +15 -12
- data/spec/unit/row_unit_spec.rb +68 -52
- data/spec/unit/scenario_unit_spec.rb +76 -62
- data/spec/unit/sourceable_unit_spec.rb +8 -6
- data/spec/unit/sourced_element_unit_specs.rb +4 -6
- data/spec/unit/step_unit_spec.rb +231 -203
- data/spec/unit/table_row_unit_spec.rb +68 -52
- data/spec/unit/table_unit_spec.rb +100 -82
- data/spec/unit/tag_unit_spec.rb +62 -48
- data/spec/unit/taggable_unit_spec.rb +58 -51
- data/spec/unit/tagged_element_unit_specs.rb +28 -26
- data/spec/unit/test_element_unit_spec.rb +33 -27
- data/spec/unit/test_element_unit_specs.rb +15 -14
- data/spec/unit/world_unit_spec.rb +94 -84
- metadata +4 -2
@@ -4,75 +4,82 @@ SimpleCov.command_name('Taggable') unless RUBY_VERSION.to_s < '1.9.0'
|
|
4
4
|
|
5
5
|
describe 'Taggable, Unit' do
|
6
6
|
|
7
|
-
nodule
|
7
|
+
let(:nodule) { CukeModeler::Taggable }
|
8
|
+
let(:element) { o = Object.new.extend(nodule)
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
def o.parent_element
|
11
|
+
@parent_element
|
12
|
+
end
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
def o.parent_element=(parent)
|
15
|
+
@parent_element = parent
|
16
|
+
end
|
17
|
+
|
18
|
+
o
|
19
|
+
}
|
20
|
+
|
21
|
+
|
22
|
+
describe 'unique behavior' do
|
15
23
|
|
16
|
-
|
17
|
-
|
24
|
+
it 'has tags' do
|
25
|
+
element.should respond_to(:tags)
|
26
|
+
element.should respond_to(:tag_elements)
|
18
27
|
end
|
19
|
-
end
|
20
28
|
|
29
|
+
it 'can change its tags' do
|
30
|
+
expect(element).to respond_to(:tags=)
|
31
|
+
expect(element).to respond_to(:tag_elements=)
|
21
32
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
33
|
+
element.tags = :some_tags
|
34
|
+
element.tags.should == :some_tags
|
35
|
+
element.tags = :some_other_tags
|
36
|
+
element.tags.should == :some_other_tags
|
26
37
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
38
|
+
element.tag_elements = :some_tag_elements
|
39
|
+
element.tag_elements.should == :some_tag_elements
|
40
|
+
element.tag_elements = :some_other_tag_elements
|
41
|
+
element.tag_elements.should == :some_other_tag_elements
|
42
|
+
end
|
32
43
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
44
|
+
it 'has applied tags' do
|
45
|
+
element.should respond_to(:applied_tags)
|
46
|
+
element.should respond_to(:applied_tag_elements)
|
47
|
+
end
|
38
48
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
49
|
+
it 'inherits its applied tags from its ancestors' do
|
50
|
+
all_parent_tag_elements = [:parent_tag_element_1, :parent_tag_element_2, :grandparent_tag_element_1]
|
51
|
+
all_parent_tags = ['@parent_tag_1', '@parent_tag_2', '@grandparent_tag_1']
|
52
|
+
parent = double(:all_tags => all_parent_tags, :all_tag_elements => all_parent_tag_elements)
|
43
53
|
|
44
|
-
|
45
|
-
all_parent_tag_elements = [:parent_tag_element_1, :parent_tag_element_2, :grandparent_tag_element_1]
|
46
|
-
all_parent_tags = ['@parent_tag_1', '@parent_tag_2', '@grandparent_tag_1']
|
47
|
-
parent = double(:all_tags => all_parent_tags, :all_tag_elements => all_parent_tag_elements)
|
54
|
+
element.parent_element = parent
|
48
55
|
|
49
|
-
|
56
|
+
element.applied_tags.should == all_parent_tags
|
57
|
+
element.applied_tag_elements.should == all_parent_tag_elements
|
58
|
+
end
|
50
59
|
|
51
|
-
|
52
|
-
|
53
|
-
|
60
|
+
it 'knows all of its applicable tags' do
|
61
|
+
all_parent_tag_elements = [:parent_tag_element_1, :parent_tag_element_2, :grandparent_tag_element_1]
|
62
|
+
all_parent_tags = ['@parent_tag_1', '@parent_tag_2', '@grandparent_tag_1']
|
63
|
+
own_tags = ['@tag_1', '@tag_2']
|
64
|
+
own_tag_elements = [:tag_element_1, :tag_element_2]
|
54
65
|
|
55
|
-
|
56
|
-
all_parent_tag_elements = [:parent_tag_element_1, :parent_tag_element_2, :grandparent_tag_element_1]
|
57
|
-
all_parent_tags = ['@parent_tag_1', '@parent_tag_2', '@grandparent_tag_1']
|
58
|
-
own_tags = ['@tag_1', '@tag_2']
|
59
|
-
own_tag_elements = [:tag_element_1, :tag_element_2]
|
66
|
+
parent = double(:all_tags => all_parent_tags, :all_tag_elements => all_parent_tag_elements)
|
60
67
|
|
61
|
-
|
68
|
+
element.parent_element = parent
|
69
|
+
element.tags = own_tags
|
70
|
+
element.tag_elements = own_tag_elements
|
62
71
|
|
63
|
-
|
64
|
-
|
65
|
-
|
72
|
+
element.all_tags.should == all_parent_tags + own_tags
|
73
|
+
element.all_tag_elements.should == all_parent_tag_elements + own_tag_elements
|
74
|
+
end
|
66
75
|
|
67
|
-
|
68
|
-
|
69
|
-
end
|
76
|
+
it 'may have no applied tags' do
|
77
|
+
element.parent_element = :not_a_tagged_object
|
70
78
|
|
71
|
-
|
72
|
-
|
79
|
+
element.applied_tags.should == []
|
80
|
+
element.applied_tag_elements.should == []
|
81
|
+
end
|
73
82
|
|
74
|
-
@element.applied_tags.should == []
|
75
|
-
@element.applied_tag_elements.should == []
|
76
83
|
end
|
77
84
|
|
78
85
|
end
|
@@ -4,35 +4,37 @@ shared_examples_for 'a tagged element' do
|
|
4
4
|
|
5
5
|
# clazz must be defined by the calling file
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
end
|
7
|
+
let(:element) { clazz.new }
|
8
|
+
|
10
9
|
|
11
10
|
it 'has tags' do
|
12
|
-
|
13
|
-
|
11
|
+
element.should respond_to(:tags)
|
12
|
+
element.should respond_to(:tag_elements)
|
14
13
|
end
|
15
14
|
|
16
15
|
it 'can get and set its tags' do
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
expect(element).to respond_to(:tags=)
|
17
|
+
expect(element).to respond_to(:tag_elements=)
|
18
|
+
|
19
|
+
element.tags = :some_tags
|
20
|
+
element.tags.should == :some_tags
|
21
|
+
element.tags = :some_other_tags
|
22
|
+
element.tags.should == :some_other_tags
|
23
|
+
|
24
|
+
element.tag_elements = :some_tag_elements
|
25
|
+
element.tag_elements.should == :some_tag_elements
|
26
|
+
element.tag_elements = :some_other_tag_elements
|
27
|
+
element.tag_elements.should == :some_other_tag_elements
|
26
28
|
end
|
27
29
|
|
28
30
|
it 'starts with no tags' do
|
29
|
-
|
30
|
-
|
31
|
+
element.tags.should == []
|
32
|
+
element.tag_elements.should == []
|
31
33
|
end
|
32
34
|
|
33
35
|
it 'has applied tags' do
|
34
|
-
|
35
|
-
|
36
|
+
element.should respond_to(:applied_tags)
|
37
|
+
element.should respond_to(:applied_tag_elements)
|
36
38
|
end
|
37
39
|
|
38
40
|
it 'inherits its applied tags from its ancestors' do
|
@@ -40,10 +42,10 @@ shared_examples_for 'a tagged element' do
|
|
40
42
|
all_parent_tags = ['@parent_tag_1', '@parent_tag_2', '@grandparent_tag_1']
|
41
43
|
parent = double(:all_tags => all_parent_tags, :all_tag_elements => all_parent_tag_elements)
|
42
44
|
|
43
|
-
|
45
|
+
element.parent_element = parent
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
+
element.applied_tags.should == all_parent_tags
|
48
|
+
element.applied_tag_elements.should == all_parent_tag_elements
|
47
49
|
end
|
48
50
|
|
49
51
|
it 'knows all of its applicable tags' do
|
@@ -54,12 +56,12 @@ shared_examples_for 'a tagged element' do
|
|
54
56
|
|
55
57
|
parent = double(:all_tags => all_parent_tags, :all_tag_elements => all_parent_tag_elements)
|
56
58
|
|
57
|
-
|
58
|
-
|
59
|
-
|
59
|
+
element.parent_element = parent
|
60
|
+
element.tags = own_tags
|
61
|
+
element.tag_elements = own_tag_elements
|
60
62
|
|
61
|
-
|
62
|
-
|
63
|
+
element.all_tags.should == all_parent_tags + own_tags
|
64
|
+
element.all_tag_elements.should == all_parent_tag_elements + own_tag_elements
|
63
65
|
end
|
64
66
|
|
65
67
|
end
|
@@ -5,44 +5,50 @@ SimpleCov.command_name('TestElement') unless RUBY_VERSION.to_s < '1.9.0'
|
|
5
5
|
describe 'TestElement, Unit' do
|
6
6
|
|
7
7
|
let(:clazz) { CukeModeler::TestElement }
|
8
|
+
let(:element) { clazz.new }
|
8
9
|
|
9
|
-
it_should_behave_like 'a test element'
|
10
|
-
it_should_behave_like 'a feature element'
|
11
|
-
it_should_behave_like 'a nested element'
|
12
|
-
it_should_behave_like 'a prepopulated element'
|
13
|
-
it_should_behave_like 'a bare bones element'
|
14
10
|
|
11
|
+
describe 'common behavior' do
|
12
|
+
|
13
|
+
it_should_behave_like 'a test element'
|
14
|
+
it_should_behave_like 'a feature element'
|
15
|
+
it_should_behave_like 'a nested element'
|
16
|
+
it_should_behave_like 'a prepopulated element'
|
17
|
+
it_should_behave_like 'a bare bones element'
|
15
18
|
|
16
|
-
before(:each) do
|
17
|
-
@element = clazz.new
|
18
19
|
end
|
19
20
|
|
20
|
-
it 'contains only steps - #contains' do
|
21
|
-
steps = [:step_1, :step_2, :step_3]
|
22
|
-
@element.steps = steps
|
23
21
|
|
24
|
-
|
25
|
-
end
|
22
|
+
describe 'unique behavior' do
|
26
23
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
element_3 = clazz.new
|
24
|
+
it 'contains only steps' do
|
25
|
+
steps = [:step_1, :step_2, :step_3]
|
26
|
+
element.steps = steps
|
31
27
|
|
32
|
-
|
33
|
-
|
34
|
-
element_3.steps = :some_other_steps
|
28
|
+
element.contains.should =~ steps
|
29
|
+
end
|
35
30
|
|
36
|
-
|
37
|
-
|
38
|
-
|
31
|
+
it 'can determine its equality with another TestElement' do
|
32
|
+
element_1 = clazz.new
|
33
|
+
element_2 = clazz.new
|
34
|
+
element_3 = clazz.new
|
39
35
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
element_1.steps = :some_steps
|
37
|
+
element_2.steps = :some_steps
|
38
|
+
element_3.steps = :some_other_steps
|
39
|
+
|
40
|
+
(element_1 == element_2).should be_true
|
41
|
+
(element_1 == element_3).should be_false
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'can gracefully be compared to other types of objects' do
|
45
|
+
# Some common types of object
|
46
|
+
[1, 'foo', :bar, [], {}].each do |thing|
|
47
|
+
expect { element == thing }.to_not raise_error
|
48
|
+
expect(element == thing).to be false
|
49
|
+
end
|
45
50
|
end
|
51
|
+
|
46
52
|
end
|
47
53
|
|
48
54
|
end
|
@@ -4,30 +4,31 @@ shared_examples_for 'a test element' do
|
|
4
4
|
|
5
5
|
# clazz must be defined by the calling file
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
end
|
7
|
+
let(:element) { clazz.new }
|
8
|
+
|
10
9
|
|
11
|
-
it 'has steps
|
12
|
-
|
10
|
+
it 'has steps' do
|
11
|
+
element.should respond_to(:steps)
|
13
12
|
end
|
14
13
|
|
15
|
-
it 'can
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
it 'can change its steps' do
|
15
|
+
expect(element).to respond_to(:steps=)
|
16
|
+
|
17
|
+
element.steps = :some_steps
|
18
|
+
element.steps.should == :some_steps
|
19
|
+
element.steps = :some_other_steps
|
20
|
+
element.steps.should == :some_other_steps
|
20
21
|
end
|
21
22
|
|
22
23
|
it 'starts with no steps' do
|
23
|
-
|
24
|
+
element.steps.should == []
|
24
25
|
end
|
25
26
|
|
26
|
-
it 'contains steps
|
27
|
+
it 'contains steps' do
|
27
28
|
steps = [:step_1, :step_2, :step_3]
|
28
|
-
|
29
|
+
element.steps = steps
|
29
30
|
|
30
|
-
steps.each { |step|
|
31
|
+
steps.each { |step| element.contains.should include(step) }
|
31
32
|
end
|
32
33
|
|
33
34
|
end
|
@@ -4,125 +4,135 @@ SimpleCov.command_name('World') unless RUBY_VERSION.to_s < '1.9.0'
|
|
4
4
|
|
5
5
|
describe 'World, Unit' do
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
@world.loaded_step_patterns.clear
|
10
|
-
@world.delimiter = nil
|
11
|
-
end
|
7
|
+
let(:nodule) { CukeModeler::World }
|
8
|
+
let(:world) { nodule }
|
12
9
|
|
13
|
-
it 'has left and right delimiters used for step argument parsing - #left_delimiter, #right_delimiter' do
|
14
|
-
@world.should respond_to(:left_delimiter)
|
15
|
-
@world.should respond_to(:right_delimiter)
|
16
|
-
end
|
17
10
|
|
18
|
-
|
19
|
-
@world.left_delimiter = '"'
|
20
|
-
@world.right_delimiter = '"'
|
21
|
-
@world.left_delimiter.should == '"'
|
22
|
-
@world.right_delimiter.should == '"'
|
11
|
+
describe 'unique behavior' do
|
23
12
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
13
|
+
before(:each) do
|
14
|
+
world.loaded_step_patterns.clear
|
15
|
+
world.delimiter = nil
|
16
|
+
end
|
29
17
|
|
30
|
-
|
31
|
-
|
32
|
-
|
18
|
+
it 'has left and right delimiters used for step argument parsing' do
|
19
|
+
world.should respond_to(:left_delimiter)
|
20
|
+
world.should respond_to(:right_delimiter)
|
21
|
+
end
|
33
22
|
|
34
|
-
|
35
|
-
|
23
|
+
it 'can get and set the delimiters used for step argument parsing' do
|
24
|
+
expect(world).to respond_to(:left_delimiter=)
|
25
|
+
expect(world).to respond_to(:right_delimiter=)
|
36
26
|
|
37
|
-
|
38
|
-
|
27
|
+
world.left_delimiter = '"'
|
28
|
+
world.right_delimiter = '"'
|
29
|
+
world.left_delimiter.should == '"'
|
30
|
+
world.right_delimiter.should == '"'
|
39
31
|
|
40
|
-
|
41
|
-
|
42
|
-
|
32
|
+
world.left_delimiter = '!'
|
33
|
+
world.right_delimiter = '!'
|
34
|
+
world.left_delimiter.should == '!'
|
35
|
+
world.right_delimiter.should == '!'
|
36
|
+
end
|
43
37
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
38
|
+
it 'can have different left and right delimiters' do
|
39
|
+
world.left_delimiter = '"'
|
40
|
+
world.right_delimiter = '*'
|
41
|
+
|
42
|
+
(world.left_delimiter != world.right_delimiter).should be_true
|
43
|
+
end
|
48
44
|
|
49
|
-
|
45
|
+
it 'can set both of its delimiters at once' do
|
46
|
+
world.delimiter = '*'
|
50
47
|
|
51
|
-
|
52
|
-
|
48
|
+
world.left_delimiter.should == '*'
|
49
|
+
world.right_delimiter.should == '*'
|
53
50
|
end
|
54
51
|
|
55
|
-
it 'starts with no
|
56
|
-
|
52
|
+
it 'starts with no delimiters' do
|
53
|
+
world.left_delimiter.should == nil
|
54
|
+
world.right_delimiter.should == nil
|
57
55
|
end
|
58
56
|
|
59
|
-
|
60
|
-
patterns = [/a pattern/, /another pattern/]
|
57
|
+
describe 'step patterns' do
|
61
58
|
|
62
|
-
patterns
|
63
|
-
|
59
|
+
it 'can load step patterns' do
|
60
|
+
world.should respond_to(:load_step_pattern)
|
64
61
|
end
|
65
62
|
|
66
|
-
|
67
|
-
|
63
|
+
it 'starts with no patterns loaded' do
|
64
|
+
world.loaded_step_patterns.should == []
|
65
|
+
end
|
68
66
|
|
69
|
-
|
70
|
-
|
71
|
-
patterns = [/a pattern/, /another pattern/]
|
67
|
+
it 'keeps track of loaded step patterns' do
|
68
|
+
patterns = [/a pattern/, /another pattern/]
|
72
69
|
|
73
|
-
File.open(file_path, 'w') { |file|
|
74
70
|
patterns.each do |pattern|
|
75
|
-
|
71
|
+
world.load_step_pattern(pattern)
|
76
72
|
end
|
77
|
-
}
|
78
73
|
|
79
|
-
|
74
|
+
world.loaded_step_patterns.should =~ patterns
|
75
|
+
end
|
80
76
|
|
81
|
-
|
82
|
-
|
77
|
+
it 'can load step definition files' do
|
78
|
+
file_path = "#{@default_file_directory}/step_file.rb"
|
79
|
+
patterns = [/a pattern/, /another pattern/]
|
83
80
|
|
84
|
-
|
85
|
-
|
86
|
-
|
81
|
+
File.open(file_path, 'w') { |file|
|
82
|
+
patterns.each do |pattern|
|
83
|
+
file.puts "Given #{pattern.inspect} do end"
|
84
|
+
end
|
85
|
+
}
|
87
86
|
|
88
|
-
|
89
|
-
file.puts "Given #{patterns[0].inspect} do end"
|
90
|
-
file.puts "When #{patterns[1].inspect} do end"
|
91
|
-
file.puts "Then #{patterns[2].inspect} do end"
|
92
|
-
file.puts "And #{patterns[3].inspect} do end"
|
93
|
-
file.puts "But #{patterns[4].inspect} do end"
|
94
|
-
}
|
87
|
+
world.load_step_file(file_path)
|
95
88
|
|
96
|
-
|
89
|
+
world.loaded_step_patterns.should =~ patterns
|
90
|
+
end
|
97
91
|
|
98
|
-
|
99
|
-
|
92
|
+
it 'can handle different step keywords' do
|
93
|
+
file_path = "#{@default_file_directory}/step_file.rb"
|
94
|
+
patterns = [/given pattern/, /when pattern/, /then pattern/, /and pattern/, /but pattern/]
|
100
95
|
|
101
|
-
|
102
|
-
|
103
|
-
|
96
|
+
File.open(file_path, 'w') { |file|
|
97
|
+
file.puts "Given #{patterns[0].inspect} do end"
|
98
|
+
file.puts "When #{patterns[1].inspect} do end"
|
99
|
+
file.puts "Then #{patterns[2].inspect} do end"
|
100
|
+
file.puts "And #{patterns[3].inspect} do end"
|
101
|
+
file.puts "But #{patterns[4].inspect} do end"
|
102
|
+
}
|
104
103
|
|
105
|
-
|
106
|
-
file.puts "Given(#{patterns[0].inspect}) do end"
|
107
|
-
file.puts "Given #{patterns[1].inspect} do end"
|
108
|
-
file.puts "Given #{patterns[2].inspect} do end"
|
109
|
-
}
|
104
|
+
world.load_step_file(file_path)
|
110
105
|
|
111
|
-
|
106
|
+
world.loaded_step_patterns.should =~ patterns
|
107
|
+
end
|
112
108
|
|
113
|
-
|
114
|
-
|
109
|
+
it 'can handle a variety of declaration structures' do
|
110
|
+
file_path = "#{@default_file_directory}/step_file.rb"
|
111
|
+
patterns = [/parentheses pattern/, /no parentheses pattern/, /excess whitespace pattern/]
|
112
|
+
|
113
|
+
File.open(file_path, 'w') { |file|
|
114
|
+
file.puts "Given(#{patterns[0].inspect}) do end"
|
115
|
+
file.puts "Given #{patterns[1].inspect} do end"
|
116
|
+
file.puts "Given #{patterns[2].inspect} do end"
|
117
|
+
}
|
115
118
|
|
116
|
-
|
117
|
-
|
119
|
+
world.load_step_file(file_path)
|
120
|
+
|
121
|
+
world.loaded_step_patterns.should =~ patterns
|
122
|
+
end
|
123
|
+
|
124
|
+
it 'can clear its loaded step patterns' do
|
125
|
+
patterns = [/a pattern/, /another pattern/]
|
126
|
+
|
127
|
+
patterns.each do |pattern|
|
128
|
+
world.load_step_pattern(pattern)
|
129
|
+
end
|
118
130
|
|
119
|
-
|
120
|
-
|
131
|
+
world.loaded_step_patterns.should =~ patterns
|
132
|
+
world.clear_step_patterns
|
133
|
+
world.loaded_step_patterns.should == []
|
121
134
|
end
|
122
135
|
|
123
|
-
@world.loaded_step_patterns.should =~ patterns
|
124
|
-
@world.clear_step_patterns
|
125
|
-
@world.loaded_step_patterns.should == []
|
126
136
|
end
|
127
137
|
|
128
138
|
end
|