cql 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,73 +1,73 @@
1
- require 'rspec'
2
- require File.dirname(__FILE__) + "/../lib/repo"
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/repo"
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/repo"
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/repo"
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.1.3
4
+ version: 0.1.5
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: 2012-09-10 00:00:00.000000000 Z
12
+ date: 2012-09-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gherkin
@@ -81,12 +81,17 @@ executables: []
81
81
  extensions: []
82
82
  extra_rdoc_files: []
83
83
  files:
84
+ - lib/dsl.rb
85
+ - lib/feature_filters.rb
86
+ - lib/map_reduce.rb
87
+ - lib/repo.rb
88
+ - lib/sso_filters.rb
84
89
  - spec/filter_feature_dsl_spec.rb
85
90
  - spec/filter_sso_spec.rb
86
91
  - spec/map_reduce_spec.rb
87
92
  - spec/select_feature_dsl_spec.rb
88
- - spec/select_scenario_dsl_spec.rb
89
93
  - spec/select_scen_outline_dsl_spec.rb
94
+ - spec/select_scenario_dsl_spec.rb
90
95
  - spec/unit_spec.rb
91
96
  homepage:
92
97
  licenses: []
@@ -123,12 +128,12 @@ rubyforge_project:
123
128
  rubygems_version: 1.8.24
124
129
  signing_key:
125
130
  specification_version: 3
126
- summary: cucumber-0.1.3
131
+ summary: cucumber-0.1.5
127
132
  test_files:
128
133
  - spec/filter_feature_dsl_spec.rb
129
134
  - spec/filter_sso_spec.rb
130
135
  - spec/map_reduce_spec.rb
131
136
  - spec/select_feature_dsl_spec.rb
132
- - spec/select_scenario_dsl_spec.rb
133
137
  - spec/select_scen_outline_dsl_spec.rb
138
+ - spec/select_scenario_dsl_spec.rb
134
139
  - spec/unit_spec.rb