cql 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cql.rb +18 -11
  3. data/lib/cql/dsl.rb +14 -2
  4. data/lib/cql/filters.rb +12 -6
  5. data/lib/cql/map_reduce.rb +29 -11
  6. data/lib/cql/model_dsl.rb +18 -0
  7. data/lib/cql/queriable.rb +14 -0
  8. data/lib/cql/sso_filters.rb +3 -2
  9. data/lib/cql/version.rb +1 -1
  10. data/testing/cql_test_model.rb +42 -0
  11. data/testing/cucumber/features/clauses/as_clause.feature +136 -0
  12. data/testing/cucumber/features/clauses/from_clause.feature +126 -0
  13. data/testing/cucumber/features/clauses/select_clause.feature +117 -0
  14. data/testing/cucumber/features/clauses/transform_clause.feature +153 -0
  15. data/testing/cucumber/features/clauses/with_clause.feature +363 -0
  16. data/testing/cucumber/features/dsl.feature +77 -0
  17. data/testing/cucumber/features/model_querying.feature +18 -0
  18. data/testing/cucumber/features/repository.feature +23 -0
  19. data/testing/cucumber/step_definitions/query_steps.rb +7 -0
  20. data/testing/cucumber/step_definitions/setup_steps.rb +25 -0
  21. data/testing/cucumber/step_definitions/verification_steps.rb +78 -0
  22. data/testing/cucumber/support/env.rb +24 -0
  23. data/testing/cucumber/support/transforms.rb +3 -0
  24. data/testing/fixtures/features/combined/a/f1_4_scenarios_5_so.feature +59 -0
  25. data/testing/fixtures/features/combined/a/f2_7_scenarios_2_so.feature +43 -0
  26. data/testing/fixtures/features/combined/a/f3_2_scenarios_3_so.feature +30 -0
  27. data/testing/fixtures/features/combined/b/f1_1_tag.feature +6 -0
  28. data/testing/fixtures/features/combined/b/f2_2_tags.feature +6 -0
  29. data/testing/fixtures/features/combined/b/f3_3_tags.feature +6 -0
  30. data/testing/fixtures/features/examples/basic/test_with_scenarios.feature +15 -0
  31. data/testing/fixtures/features/examples/filters/tag_count/simple.feature +21 -0
  32. data/testing/fixtures/features/examples/filters/tag_count/simple2.feature +21 -0
  33. data/testing/fixtures/features/examples/filters/tags/simple.feature +34 -0
  34. data/testing/fixtures/features/examples/filters/tags2/simple.feature +34 -0
  35. data/testing/fixtures/features/examples/filters/tags2/simple2.feature +34 -0
  36. data/testing/fixtures/features/examples/multiple_examples/test_with_scenarios.feature +43 -0
  37. data/testing/fixtures/features/examples/name_filter/name.feature +19 -0
  38. data/testing/fixtures/features/got/Lannisters.feature +24 -0
  39. data/testing/fixtures/features/got/Starks.feature +18 -0
  40. data/testing/fixtures/features/scen_outlines/basic/test_with_scenarios.feature +15 -0
  41. data/testing/fixtures/features/scen_outlines/filters/tag_count/simple.feature +21 -0
  42. data/testing/fixtures/features/scen_outlines/filters/tag_count/simple2.feature +21 -0
  43. data/testing/fixtures/features/scen_outlines/filters/tags/simple.feature +34 -0
  44. data/testing/fixtures/features/scen_outlines/filters/tags2/simple.feature +34 -0
  45. data/testing/fixtures/features/scen_outlines/filters/tags2/simple2.feature +34 -0
  46. data/testing/fixtures/features/scen_outlines/line_count/simple.feature +12 -0
  47. data/testing/fixtures/features/scen_outlines/line_count/simple2.feature +16 -0
  48. data/testing/fixtures/features/scen_outlines/line_filter/ll.feature +13 -0
  49. data/testing/fixtures/features/scen_outlines/multiple_examples/test_with_scenarios.feature +43 -0
  50. data/testing/fixtures/features/scen_outlines/name_filter/name.feature +19 -0
  51. data/testing/fixtures/features/scenario/line_count/simple.feature +9 -0
  52. data/testing/fixtures/features/scenario/line_count/simple2.feature +12 -0
  53. data/testing/fixtures/features/scenario/line_filter/ll.feature +9 -0
  54. data/testing/fixtures/features/scenario/name_filter/name.feature +13 -0
  55. data/testing/fixtures/features/scenario/simple/simple.feature +8 -0
  56. data/testing/fixtures/features/scenario/simple/test.feature +9 -0
  57. data/testing/fixtures/features/scenario/simple/test2.feature +5 -0
  58. data/testing/fixtures/features/scenario/simple/test_full.feature +22 -0
  59. data/testing/fixtures/features/scenario/simple2/test_full.feature +23 -0
  60. data/testing/fixtures/features/scenario/table/simple.feature +11 -0
  61. data/testing/fixtures/features/scenario/tag_count/simple.feature +17 -0
  62. data/testing/fixtures/features/scenario/tag_count/simple2.feature +17 -0
  63. data/testing/fixtures/features/scenario/tagged_features/simple.feature +8 -0
  64. data/testing/fixtures/features/scenario/tagged_features/test.feature +10 -0
  65. data/testing/fixtures/features/scenario/tagged_features/test2.feature +6 -0
  66. data/testing/fixtures/features/scenario/tagged_features/test_full.feature +22 -0
  67. data/testing/fixtures/features/scenario/tags/simple.feature +24 -0
  68. data/testing/fixtures/features/scenario/tags2/simple.feature +24 -0
  69. data/testing/fixtures/features/scenario/tags2/simple2.feature +24 -0
  70. data/testing/fixtures/features/scenario/tags3/simple.feature +21 -0
  71. data/testing/gemfiles/cuke_modeler0.gemfile +30 -0
  72. data/testing/gemfiles/cuke_modeler1.gemfile +30 -0
  73. data/testing/rspec/spec/dsl_spec.rb +600 -0
  74. data/testing/rspec/spec/filter_example_spec.rb +65 -0
  75. data/testing/rspec/spec/filter_feature_dsl_spec.rb +286 -0
  76. data/testing/rspec/spec/filter_sso_spec.rb +202 -0
  77. data/testing/rspec/spec/line_count_filterable_specs.rb +74 -0
  78. data/testing/rspec/spec/line_filterable_specs.rb +52 -0
  79. data/testing/rspec/spec/map_reduce_spec.rb +135 -0
  80. data/testing/rspec/spec/model_query_spec.rb +49 -0
  81. data/testing/rspec/spec/multiple_queries_spec.rb +24 -0
  82. data/testing/rspec/spec/name_filterable_specs.rb +52 -0
  83. data/testing/rspec/spec/queriable_specs.rb +45 -0
  84. data/testing/rspec/spec/repository_spec.rb +82 -0
  85. data/testing/rspec/spec/select_feature_dsl_spec.rb +114 -0
  86. data/testing/rspec/spec/select_scen_outline_dsl_spec.rb +234 -0
  87. data/testing/rspec/spec/select_scenario_dsl_spec.rb +132 -0
  88. data/testing/rspec/spec/spec_helper.rb +42 -0
  89. data/testing/rspec/spec/tag_filterable_specs.rb +107 -0
  90. metadata +170 -5
@@ -0,0 +1,21 @@
1
+ Feature: Simple2
2
+
3
+ Scenario Outline:
4
+ Given Something
5
+ | a | a |
6
+ | s | a |
7
+ | s | s |
8
+ Then something else
9
+ @one @two @three
10
+ Examples: 3 tags
11
+ | param |
12
+
13
+ Scenario Outline:
14
+ Given Something
15
+ | a | a |
16
+ | s | a |
17
+ | s | s |
18
+ Then something else
19
+ @one @two @three @four
20
+ Examples: 4 tags
21
+ | param |
@@ -0,0 +1,34 @@
1
+ Feature: Simple
2
+
3
+ Scenario Outline:
4
+ Given Something
5
+ | a | a |
6
+ | s | a |
7
+ | s | s |
8
+ Then something else
9
+ @two
10
+ Examples: Has a table
11
+ | param |
12
+
13
+ Scenario Outline:
14
+ Given anything
15
+ @one
16
+ Examples: Next
17
+ | param |
18
+
19
+ Scenario Outline:
20
+ Given lalala
21
+ @two
22
+ Examples: Blah
23
+ | param |
24
+
25
+ Scenario Outline:
26
+ Given a car
27
+ @one
28
+ Examples: Another
29
+ | param |
30
+
31
+ Scenario Outline:
32
+ Given a car
33
+ Examples: Yet Another
34
+ | param |
@@ -0,0 +1,34 @@
1
+ Feature: Simple
2
+
3
+ Scenario Outline:
4
+ Given Something
5
+ | a | a |
6
+ | s | a |
7
+ | s | s |
8
+ Then something else
9
+ @two
10
+ Examples: Has a table
11
+ | param |
12
+
13
+ Scenario Outline:
14
+ Given anything
15
+ @one
16
+ Examples: Next
17
+ | param |
18
+
19
+ Scenario Outline:
20
+ Given a car
21
+ Examples: Another
22
+ | param |
23
+
24
+ Scenario Outline:
25
+ Given lalala
26
+ @two
27
+ Examples: Blah
28
+ | param |
29
+
30
+ Scenario Outline:
31
+ Given a car
32
+ @one
33
+ Examples: Another
34
+ | param |
@@ -0,0 +1,34 @@
1
+ Feature: Simple 2
2
+
3
+ Scenario Outline:
4
+ Given Something
5
+ | a | a |
6
+ | s | a |
7
+ | s | s |
8
+ Then something else
9
+ @two @four
10
+ Examples: Has a table hmmm
11
+ | param |
12
+
13
+ Scenario Outline:
14
+ Given anything
15
+ @one @five
16
+ Examples: Next
17
+ | param |
18
+
19
+ Scenario Outline:
20
+ Given a car
21
+ Examples: Another
22
+ | param |
23
+
24
+ Scenario Outline:
25
+ Given lalala
26
+ @two
27
+ Examples: Blah blah
28
+ | param |
29
+
30
+ Scenario Outline:
31
+ Given a car
32
+ @one
33
+ Examples: Another
34
+ | param |
@@ -0,0 +1,43 @@
1
+ Feature: Test Feature
2
+
3
+ Scenario Outline: An Outline
4
+ Given something happend
5
+ Then I expect something else
6
+ Examples: One
7
+ | var_a | var_b |
8
+ | 1 | a |
9
+ | 2 | b |
10
+
11
+ Examples: Two
12
+ | var_a | var_b |
13
+ | 1 | a |
14
+ | 2 | b |
15
+
16
+
17
+ Scenario: A Scenario
18
+ Given something happend
19
+ Then I expect something else
20
+
21
+ @outline_tag
22
+ Scenario Outline: An Outline with everything
23
+
24
+ Outline description.
25
+
26
+ Given something happend
27
+ | a | a |
28
+ | s | a |
29
+ | s | s |
30
+ Then I expect something else
31
+ Examples: One
32
+ This is example One.
33
+
34
+ | var_a | var_b |
35
+ | 1 | a |
36
+ | 2 | b |
37
+
38
+ @example_tag
39
+ Examples: Two
40
+ | var_a | var_b |
41
+ | 1 | a |
42
+ | 2 | b |
43
+
@@ -0,0 +1,19 @@
1
+ Feature: Names1
2
+
3
+ Scenario Outline:
4
+ Given Something
5
+ Then something else
6
+ Examples: name1
7
+ | param |
8
+
9
+ Scenario Outline:
10
+ Given Something
11
+ Then something else
12
+ Examples: name2
13
+ | param |
14
+
15
+ Scenario Outline:
16
+ Given Something
17
+ Then something else
18
+ Examples: name3
19
+ | param |
@@ -0,0 +1,24 @@
1
+ Feature: Lannisters
2
+
3
+ @Stark @Baratheon @Lannister
4
+ Scenario: Strange relations
5
+ Given "Cersai Lannister" is married to "King Robert Baratheon"
6
+ And they have a child "Joffrey Baratheon"
7
+ But "Jaime Lannister" is really the father
8
+ Then the "Starks" will be in trouble
9
+
10
+ @Lannister
11
+ Scenario: Family Honour
12
+ Given "Tywin Lannister" is ashamed of his dad
13
+ And he wants the family name to continue
14
+ And he craves power
15
+ Then "Tywin Lannister" will build an army
16
+ And become hand of the king
17
+
18
+ @Targaryen @Lannister
19
+ Scenario: Actually a good guy
20
+ Given "Jamie Lannister" is in the "King's Guard"
21
+ And the "Mad King" wants to burn the city
22
+ Then "Jamie Lannister" will kill the "Mad King"
23
+ And "King's Landing" will be saved
24
+ And "Jamie Lannister" will become known as the "King Slayer"
@@ -0,0 +1,18 @@
1
+ Feature: Starks
2
+
3
+ @Stark @Snow
4
+ Scenario: Bastard Child
5
+ Given "Ned Stark" has a mistress
6
+ And they have a child
7
+ Then the child will be called "Jon Snow"
8
+ And he will join the "Night's Watch"
9
+
10
+ @Stark @Baratheon
11
+ Scenario: Hand of the king
12
+ Given "Robert Baratheon" is king
13
+ And "Ned Stark" is friends with "Robert Baratheon"
14
+ Then "Ned Stark" will become "Hand of the King"
15
+ And "Ned Stark" will have the following responsibilities
16
+ | Ensuring Justice |
17
+ | Protecting the king |
18
+ | Finding out about conspiracies |
@@ -0,0 +1,15 @@
1
+ Feature: Test Feature
2
+
3
+ Scenario Outline: An Outline
4
+ Given something happend
5
+ Then I expect something else
6
+ Examples:
7
+ | var_a | var_b |
8
+ | 1 | a |
9
+ | 2 | b |
10
+ | 3 | c |
11
+ | 4 | d |
12
+
13
+ Scenario: A Scenario
14
+ Given something happend
15
+ Then I expect something else
@@ -0,0 +1,21 @@
1
+ Feature: Simple
2
+
3
+ @one
4
+ Scenario Outline: 1 tag
5
+ Given Something
6
+ | a | a |
7
+ | s | a |
8
+ | s | s |
9
+ Then something else
10
+ Examples:
11
+ | param |
12
+
13
+ @one @two
14
+ Scenario Outline: 2 tags
15
+ Given Something
16
+ | a | a |
17
+ | s | a |
18
+ | s | s |
19
+ Then something else
20
+ Examples:
21
+ | param |
@@ -0,0 +1,21 @@
1
+ Feature: Simple2
2
+
3
+ @one @two @three
4
+ Scenario Outline: 3 tags
5
+ Given Something
6
+ | a | a |
7
+ | s | a |
8
+ | s | s |
9
+ Then something else
10
+ Examples:
11
+ | param |
12
+
13
+ @one @two @three @four
14
+ Scenario Outline: 4 tags
15
+ Given Something
16
+ | a | a |
17
+ | s | a |
18
+ | s | s |
19
+ Then something else
20
+ Examples:
21
+ | param |
@@ -0,0 +1,34 @@
1
+ Feature: Simple
2
+
3
+ @two
4
+ Scenario Outline: Has a table
5
+ Given Something
6
+ | a | a |
7
+ | s | a |
8
+ | s | s |
9
+ Then something else
10
+ Examples:
11
+ | param |
12
+
13
+ @one
14
+ Scenario Outline: Next
15
+ Given anything
16
+ Examples:
17
+ | param |
18
+
19
+ @two
20
+ Scenario Outline: Blah
21
+ Given lalala
22
+ Examples:
23
+ | param |
24
+
25
+ @one
26
+ Scenario Outline: Another
27
+ Given a car
28
+ Examples:
29
+ | param |
30
+
31
+ Scenario Outline: Yet Another
32
+ Given a car
33
+ Examples:
34
+ | param |
@@ -0,0 +1,34 @@
1
+ Feature: Simple
2
+
3
+ @two
4
+ Scenario Outline: Has a table
5
+ Given Something
6
+ | a | a |
7
+ | s | a |
8
+ | s | s |
9
+ Then something else
10
+ Examples:
11
+ | param |
12
+
13
+ @one
14
+ Scenario Outline: Next
15
+ Given anything
16
+ Examples:
17
+ | param |
18
+
19
+ Scenario Outline: Another
20
+ Given a car
21
+ Examples:
22
+ | param |
23
+
24
+ @two
25
+ Scenario Outline: Blah
26
+ Given lalala
27
+ Examples:
28
+ | param |
29
+
30
+ @one
31
+ Scenario Outline: Another
32
+ Given a car
33
+ Examples:
34
+ | param |
@@ -0,0 +1,34 @@
1
+ Feature: Simple 2
2
+
3
+ @two @four
4
+ Scenario Outline: Has a table hmmm
5
+ Given Something
6
+ | a | a |
7
+ | s | a |
8
+ | s | s |
9
+ Then something else
10
+ Examples:
11
+ | param |
12
+
13
+ @one @five
14
+ Scenario Outline: Next
15
+ Given anything
16
+ Examples:
17
+ | param |
18
+
19
+ Scenario Outline: Another
20
+ Given a car
21
+ Examples:
22
+ | param |
23
+
24
+ @two
25
+ Scenario Outline: Blah blah
26
+ Given lalala
27
+ Examples:
28
+ | param |
29
+
30
+ @one
31
+ Scenario Outline: Another
32
+ Given a car
33
+ Examples:
34
+ | param |
@@ -0,0 +1,12 @@
1
+ Feature: Line Count
2
+
3
+ Scenario Outline: 1 line
4
+ Given Something
5
+ Examples:
6
+ | param |
7
+
8
+ Scenario Outline: 2 lines
9
+ Given Something
10
+ Then something else
11
+ Examples:
12
+ | param |
@@ -0,0 +1,16 @@
1
+ Feature: Line Count 2
2
+
3
+ Scenario Outline: 3 lines
4
+ Given Something
5
+ Then something else
6
+ Then something else
7
+ Examples:
8
+ | param |
9
+
10
+ Scenario Outline: 4 lines
11
+ Given Something
12
+ Given Something
13
+ Given Something
14
+ Given Something
15
+ Examples:
16
+ | param |
@@ -0,0 +1,13 @@
1
+ Feature: Simple
2
+
3
+ Scenario Outline: sc1
4
+ Given all match
5
+ Then green eggs and ham
6
+ Examples:
7
+ | param |
8
+
9
+ Scenario Outline: sc2
10
+ Given some other phrase
11
+ Then all match
12
+ Examples:
13
+ | param |