cql 0.1.9 → 0.2
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 +62 -62
- data/lib/dsl.rb +110 -110
- data/lib/feature_filters.rb +72 -72
- data/lib/map_reduce.rb +39 -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/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
- data/spec/unit_spec.rb +21 -21
- metadata +3 -3
@@ -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
|
data/spec/unit_spec.rb
CHANGED
@@ -1,22 +1,22 @@
|
|
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
|
-
|
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
22
|
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'
|
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-01-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gherkin
|
@@ -128,7 +128,7 @@ rubyforge_project:
|
|
128
128
|
rubygems_version: 1.8.24
|
129
129
|
signing_key:
|
130
130
|
specification_version: 3
|
131
|
-
summary: cucumber-0.
|
131
|
+
summary: cucumber-0.2
|
132
132
|
test_files:
|
133
133
|
- spec/filter_feature_dsl_spec.rb
|
134
134
|
- spec/filter_sso_spec.rb
|