cql 0.1.9 → 0.2.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.
- data/lib/cql.rb +63 -62
- data/lib/dsl.rb +110 -110
- data/lib/feature_filters.rb +72 -72
- data/lib/map_reduce.rb +40 -39
- data/lib/sso_filters.rb +72 -72
- data/spec/filter_feature_dsl_spec.rb +485 -485
- data/spec/filter_sso_spec.rb +287 -287
- data/spec/map_reduce_spec.rb +131 -131
- data/spec/multiple_queries_spec.rb +28 -0
- data/spec/select_feature_dsl_spec.rb +49 -49
- data/spec/select_scen_outline_dsl_spec.rb +125 -125
- data/spec/select_scenario_dsl_spec.rb +72 -72
- metadata +9 -20
- data/spec/unit_spec.rb +0 -22
@@ -1,73 +1,73 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
require File.dirname(__FILE__) + "/../lib/cql"
|
3
|
-
|
4
|
-
describe "select" do
|
5
|
-
|
6
|
-
describe "single value, multiple results" do
|
7
|
-
it 'should get scenario line number' do
|
8
|
-
gr = CQL::Repository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/scenario/simple2"
|
9
|
-
result = gr.query do
|
10
|
-
select line
|
11
|
-
from scenarios
|
12
|
-
end
|
13
|
-
result.should == [{"line"=> 6}, {"line"=> 11}, {"line"=> 16}, {"line"=> 21}]
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'should get scenario name' do
|
17
|
-
gr = CQL::Repository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/scenario/simple2"
|
18
|
-
result = gr.query do
|
19
|
-
select name
|
20
|
-
from scenarios
|
21
|
-
end
|
22
|
-
result.should == [{"name"=> "Testing the slurping"}, {"name"=> "Testing again"},
|
23
|
-
{"name"=> "Testing yet again"}, {"name"=> "Testing yet again part 2"}]
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should get scenario name from multiple feature files' do
|
27
|
-
gr = CQL::Repository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/scenario/simple"
|
28
|
-
result = gr.query do
|
29
|
-
select name
|
30
|
-
from scenarios
|
31
|
-
end
|
32
|
-
result.should == [{"name"=> "Has a table"}, {"name"=> "Testing the slurping 1"},
|
33
|
-
{"name"=> "Testing the slurping not to be found"}, {"name"=> "Testing the slurping 2"},
|
34
|
-
{"name"=> "Testing the slurping 3"}, {"name"=> "Testing again"},
|
35
|
-
{"name"=> "Testing yet again"}, {"name"=> "Testing yet again part 2"}]
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
describe "multiple values" do
|
40
|
-
it 'should get multiple scenarios as a list of maps' do
|
41
|
-
gr = CQL::Repository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/scenario/simple2"
|
42
|
-
result = gr.query do
|
43
|
-
select line, name
|
44
|
-
from scenarios
|
45
|
-
end
|
46
|
-
result.should == [{'line'=>6, 'name'=>"Testing the slurping"}, {'line'=>11, 'name'=>"Testing again"},
|
47
|
-
{'line'=>16, 'name'=>"Testing yet again"}, {'line'=>21, 'name'=>"Testing yet again part 2"}]
|
48
|
-
end
|
49
|
-
|
50
|
-
it "should select all" do
|
51
|
-
gr = CQL::Repository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/scenario/table"
|
52
|
-
expected = {"all"=>{"keyword"=>"Scenario", "name"=>"Has a table", "line"=>3,
|
53
|
-
"description"=>"", "id"=>"simple;has-a-table", "type"=>"scenario",
|
54
|
-
"steps"=>[{"keyword"=>"Given ", "name"=>"Something", "line"=>4,
|
55
|
-
"rows"=>[{"cells"=>["a", "a"], "line"=>5}, {"cells"=>["s", "a"], "line"=>6},
|
56
|
-
{"cells"=>["s", "s"], "line"=>7}]},
|
57
|
-
{"keyword"=>"Then ", "name"=>"something else", "line"=>8}]}}
|
58
|
-
|
59
|
-
result = gr.query do
|
60
|
-
select all
|
61
|
-
from scenarios
|
62
|
-
end
|
63
|
-
result.should == expected
|
64
|
-
|
65
|
-
result = gr.query do
|
66
|
-
select complete
|
67
|
-
from scenarios
|
68
|
-
end
|
69
|
-
result.should == expected
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
1
|
+
require 'rspec'
|
2
|
+
require File.dirname(__FILE__) + "/../lib/cql"
|
3
|
+
|
4
|
+
describe "select" do
|
5
|
+
|
6
|
+
describe "single value, multiple results" do
|
7
|
+
it 'should get scenario line number' do
|
8
|
+
gr = CQL::Repository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/scenario/simple2"
|
9
|
+
result = gr.query do
|
10
|
+
select line
|
11
|
+
from scenarios
|
12
|
+
end
|
13
|
+
result.should == [{"line"=> 6}, {"line"=> 11}, {"line"=> 16}, {"line"=> 21}]
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should get scenario name' do
|
17
|
+
gr = CQL::Repository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/scenario/simple2"
|
18
|
+
result = gr.query do
|
19
|
+
select name
|
20
|
+
from scenarios
|
21
|
+
end
|
22
|
+
result.should == [{"name"=> "Testing the slurping"}, {"name"=> "Testing again"},
|
23
|
+
{"name"=> "Testing yet again"}, {"name"=> "Testing yet again part 2"}]
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should get scenario name from multiple feature files' do
|
27
|
+
gr = CQL::Repository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/scenario/simple"
|
28
|
+
result = gr.query do
|
29
|
+
select name
|
30
|
+
from scenarios
|
31
|
+
end
|
32
|
+
result.should == [{"name"=> "Has a table"}, {"name"=> "Testing the slurping 1"},
|
33
|
+
{"name"=> "Testing the slurping not to be found"}, {"name"=> "Testing the slurping 2"},
|
34
|
+
{"name"=> "Testing the slurping 3"}, {"name"=> "Testing again"},
|
35
|
+
{"name"=> "Testing yet again"}, {"name"=> "Testing yet again part 2"}]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "multiple values" do
|
40
|
+
it 'should get multiple scenarios as a list of maps' do
|
41
|
+
gr = CQL::Repository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/scenario/simple2"
|
42
|
+
result = gr.query do
|
43
|
+
select line, name
|
44
|
+
from scenarios
|
45
|
+
end
|
46
|
+
result.should == [{'line'=>6, 'name'=>"Testing the slurping"}, {'line'=>11, 'name'=>"Testing again"},
|
47
|
+
{'line'=>16, 'name'=>"Testing yet again"}, {'line'=>21, 'name'=>"Testing yet again part 2"}]
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should select all" do
|
51
|
+
gr = CQL::Repository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/scenario/table"
|
52
|
+
expected = [{"all"=>{"keyword"=>"Scenario", "name"=>"Has a table", "line"=>3,
|
53
|
+
"description"=>"", "id"=>"simple;has-a-table", "type"=>"scenario",
|
54
|
+
"steps"=>[{"keyword"=>"Given ", "name"=>"Something", "line"=>4,
|
55
|
+
"rows"=>[{"cells"=>["a", "a"], "line"=>5}, {"cells"=>["s", "a"], "line"=>6},
|
56
|
+
{"cells"=>["s", "s"], "line"=>7}]},
|
57
|
+
{"keyword"=>"Then ", "name"=>"something else", "line"=>8}]}} ]
|
58
|
+
|
59
|
+
result = gr.query do
|
60
|
+
select all
|
61
|
+
from scenarios
|
62
|
+
end
|
63
|
+
result.should == expected
|
64
|
+
|
65
|
+
result = gr.query do
|
66
|
+
select complete
|
67
|
+
from scenarios
|
68
|
+
end
|
69
|
+
result.should == expected
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
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:
|
12
|
+
date: 2013-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gherkin
|
@@ -89,24 +89,13 @@ files:
|
|
89
89
|
- spec/filter_feature_dsl_spec.rb
|
90
90
|
- spec/filter_sso_spec.rb
|
91
91
|
- spec/map_reduce_spec.rb
|
92
|
+
- spec/multiple_queries_spec.rb
|
92
93
|
- spec/select_feature_dsl_spec.rb
|
93
|
-
- spec/select_scenario_dsl_spec.rb
|
94
94
|
- spec/select_scen_outline_dsl_spec.rb
|
95
|
-
- spec/
|
95
|
+
- spec/select_scenario_dsl_spec.rb
|
96
96
|
homepage:
|
97
97
|
licenses: []
|
98
|
-
post_install_message:
|
99
|
-
|
100
|
-
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
|
101
|
-
|
102
|
-
|
103
|
-
Thank you for installing cql (Cucumber Query Language)
|
104
|
-
|
105
|
-
|
106
|
-
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
|
107
|
-
|
108
|
-
|
109
|
-
'
|
98
|
+
post_install_message:
|
110
99
|
rdoc_options:
|
111
100
|
- --charset=UTF-8
|
112
101
|
require_paths:
|
@@ -125,15 +114,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
114
|
version: '0'
|
126
115
|
requirements: []
|
127
116
|
rubyforge_project:
|
128
|
-
rubygems_version: 1.8.
|
117
|
+
rubygems_version: 1.8.25
|
129
118
|
signing_key:
|
130
119
|
specification_version: 3
|
131
|
-
summary: cucumber-0.
|
120
|
+
summary: cucumber-0.2.0
|
132
121
|
test_files:
|
133
122
|
- spec/filter_feature_dsl_spec.rb
|
134
123
|
- spec/filter_sso_spec.rb
|
135
124
|
- spec/map_reduce_spec.rb
|
125
|
+
- spec/multiple_queries_spec.rb
|
136
126
|
- spec/select_feature_dsl_spec.rb
|
137
|
-
- spec/select_scenario_dsl_spec.rb
|
138
127
|
- spec/select_scen_outline_dsl_spec.rb
|
139
|
-
- spec/
|
128
|
+
- spec/select_scenario_dsl_spec.rb
|
data/spec/unit_spec.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
require File.dirname(__FILE__) + "/../lib/cql"
|
3
|
-
|
4
|
-
describe "cql" do
|
5
|
-
|
6
|
-
describe "tag searcher" do
|
7
|
-
it "should be able to search for tags" do
|
8
|
-
#tags_given = [{"name"=>"@one", "line"=>3}, {"name"=>"@four", "line"=>3}, {"name"=>"@six", "line"=>3}, {"name"=>"@seven", "line"=>3}]
|
9
|
-
#CQL::MapReduce.has_tags(tags_given, ["@one", "@four"]).should eql true
|
10
|
-
#
|
11
|
-
#tags_given = [{"name"=>"@two", "line"=>3}, {"name"=>"@four", "line"=>3}, {"name"=>"@six", "line"=>3}, {"name"=>"@seven", "line"=>3}]
|
12
|
-
#CQL::MapReduce.has_tags(tags_given, ["@one", "@four"]).should eql false
|
13
|
-
#
|
14
|
-
#tags_given = [{"name"=>"@two", "line"=>3}, {"name"=>"@four", "line"=>3}, {"name"=>"@six", "line"=>3}, {"name"=>"@seven", "line"=>3}]
|
15
|
-
#CQL::MapReduce.has_tags(tags_given, ["@four"]).should eql true
|
16
|
-
#
|
17
|
-
#tags_given = [{"name"=>"@two", "line"=>3}, {"name"=>"@four", "line"=>3}, {"name"=>"@six", "line"=>3}, {"name"=>"@seven", "line"=>3}]
|
18
|
-
#CQL::MapReduce.has_tags(tags_given, ["@four", "@two", "@six", "@seven"]).should eql true
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|