cucumber 2.0.0.beta.2 → 2.0.0.beta.3

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +25 -7
  3. data/cucumber.gemspec +1 -1
  4. data/features/docs/defining_steps/nested_steps.feature +0 -1
  5. data/features/docs/defining_steps/printing_messages.feature +1 -0
  6. data/features/docs/defining_steps/table_diffing.feature +9 -4
  7. data/features/docs/exception_in_after_step_hook.feature +1 -0
  8. data/features/docs/formatters/json_formatter.feature +51 -4
  9. data/features/docs/formatters/junit_formatter.feature +1 -0
  10. data/features/docs/gherkin/outlines.feature +4 -0
  11. data/features/docs/output_from_hooks.feature +128 -0
  12. data/features/docs/wire_protocol_table_diffing.feature +6 -2
  13. data/features/docs/writing_support_code/after_hooks.feature +56 -0
  14. data/lib/cucumber/cli/configuration.rb +0 -4
  15. data/lib/cucumber/cli/main.rb +0 -1
  16. data/lib/cucumber/cli/options.rb +0 -3
  17. data/lib/cucumber/formatter/console.rb +3 -1
  18. data/lib/cucumber/formatter/debug.rb +4 -0
  19. data/lib/cucumber/formatter/gherkin_formatter_adapter.rb +26 -3
  20. data/lib/cucumber/formatter/html.rb +6 -2
  21. data/lib/cucumber/formatter/usage.rb +1 -58
  22. data/lib/cucumber/mappings.rb +25 -7
  23. data/lib/cucumber/multiline_argument.rb +40 -82
  24. data/lib/cucumber/multiline_argument/data_table.rb +719 -0
  25. data/lib/cucumber/multiline_argument/doc_string.rb +10 -0
  26. data/lib/cucumber/platform.rb +1 -1
  27. data/lib/cucumber/rb_support/rb_world.rb +2 -4
  28. data/lib/cucumber/reports/legacy_formatter.rb +69 -22
  29. data/lib/cucumber/runtime.rb +0 -39
  30. data/lib/cucumber/runtime/for_programming_languages.rb +12 -10
  31. data/lib/cucumber/runtime/support_code.rb +11 -4
  32. data/lib/cucumber/wire_support/wire_protocol/requests.rb +2 -2
  33. data/spec/cucumber/formatter/pretty_spec.rb +5 -5
  34. data/spec/cucumber/mappings_spec.rb +137 -8
  35. data/spec/cucumber/multiline_argument/data_table_spec.rb +508 -0
  36. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +3 -3
  37. data/spec/cucumber/rb_support/snippet_spec.rb +1 -1
  38. data/spec/cucumber/runtime/for_programming_languages_spec.rb +16 -12
  39. metadata +13 -6
  40. data/lib/cucumber/runtime/features_loader.rb +0 -62
@@ -37,10 +37,10 @@ module Cucumber
37
37
  it "allows calling of other steps with inline arg" do
38
38
  dsl.Given(/Outside/) do
39
39
  location = Core::Ast::Location.new(__FILE__, __LINE__)
40
- step "Inside", MultilineArgument.from(Cucumber::Core::Ast::DataTable.new([['inside']], location))
40
+ step "Inside", table([['inside']])
41
41
  end
42
- dsl.Given(/Inside/) do |table|
43
- $inside = table.raw[0][0]
42
+ dsl.Given(/Inside/) do |t|
43
+ $inside = t.raw[0][0]
44
44
  end
45
45
 
46
46
  run_step "Outside"
@@ -99,7 +99,7 @@ module Cucumber
99
99
 
100
100
  it "is helpful with doc string" do
101
101
  @pattern = 'A "first" arg'
102
- @multiline_argument = Core::Ast::MultilineArgument.from("", Core::Ast::Location.new(""))
102
+ @multiline_argument = MultilineArgument.from("", Core::Ast::Location.new(""))
103
103
 
104
104
  expect(snippet_text).to eq unindented(%{
105
105
  Given(/^A "(.*?)" arg$/) do |arg1, string|
@@ -7,26 +7,30 @@ module Cucumber
7
7
  subject { Runtime::SupportCode.new(user_interface,{}) }
8
8
  let(:runtime_facade) { Runtime::ForProgrammingLanguages.new(subject, user_interface) }
9
9
 
10
- it 'produces Ast::DocString by #doc_string with default content-type' do
11
- str = runtime_facade.doc_string('DOC')
10
+ describe "#doc_string" do
12
11
 
13
- expect(str).to be_kind_of(Core::Ast::DocString)
14
- expect(str.content_type).to eq('')
15
- end
12
+ it 'defaults to a blank content-type' do
13
+ str = runtime_facade.doc_string('DOC')
14
+ expect(str).to be_kind_of(MultilineArgument::DocString)
15
+ expect(str.content_type).to eq('')
16
+ end
16
17
 
17
- it 'produces Ast::DocString by #doc_string with ruby content-type' do
18
- str = runtime_facade.doc_string('DOC','ruby')
18
+ it 'can have a content type' do
19
+ str = runtime_facade.doc_string('DOC','ruby')
20
+ expect(str.content_type).to eq('ruby')
21
+ end
19
22
 
20
- expect(str).to be_kind_of(Core::Ast::DocString)
21
- expect(str.content_type).to eq('ruby')
22
23
  end
23
24
 
24
- it 'produces Ast::Table by #table' do
25
- expect(runtime_facade.table(%{
25
+ describe "#table" do
26
+
27
+ it 'produces Ast::Table by #table' do
28
+ expect(runtime_facade.table(%{
26
29
  | account | description | amount |
27
30
  | INT-100 | Taxi | 114 |
28
31
  | CUC-101 | Peeler | 22 |
29
- })).to be_kind_of(Core::Ast::DataTable)
32
+ })).to be_kind_of(MultilineArgument::DataTable)
33
+ end
30
34
  end
31
35
  end
32
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta.2
4
+ version: 2.0.0.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-29 00:00:00.000000000 Z
11
+ date: 2014-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0.beta.2
19
+ version: 1.0.0.beta.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0.beta.2
26
+ version: 1.0.0.beta.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: builder
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -589,6 +589,7 @@ files:
589
589
  - features/docs/gherkin/using_descriptions.feature
590
590
  - features/docs/gherkin/using_star_notation.feature
591
591
  - features/docs/iso-8859-1.feature
592
+ - features/docs/output_from_hooks.feature
592
593
  - features/docs/post_configuration_hook.feature
593
594
  - features/docs/profiles.feature
594
595
  - features/docs/rake_task.feature
@@ -600,6 +601,7 @@ files:
600
601
  - features/docs/wire_protocol_tags.feature
601
602
  - features/docs/wire_protocol_timeouts.feature
602
603
  - features/docs/work_in_progress.feature
604
+ - features/docs/writing_support_code/after_hooks.feature
603
605
  - features/docs/writing_support_code/around_hooks.feature
604
606
  - features/docs/writing_support_code/before_hook.feature
605
607
  - features/docs/writing_support_code/hook_order.feature
@@ -687,6 +689,8 @@ files:
687
689
  - lib/cucumber/load_path.rb
688
690
  - lib/cucumber/mappings.rb
689
691
  - lib/cucumber/multiline_argument.rb
692
+ - lib/cucumber/multiline_argument/data_table.rb
693
+ - lib/cucumber/multiline_argument/doc_string.rb
690
694
  - lib/cucumber/platform.rb
691
695
  - lib/cucumber/rake/task.rb
692
696
  - lib/cucumber/rb_support/rb_dsl.rb
@@ -701,7 +705,6 @@ files:
701
705
  - lib/cucumber/rspec/disable_option_parser.rb
702
706
  - lib/cucumber/rspec/doubles.rb
703
707
  - lib/cucumber/runtime.rb
704
- - lib/cucumber/runtime/features_loader.rb
705
708
  - lib/cucumber/runtime/for_programming_languages.rb
706
709
  - lib/cucumber/runtime/gated_receiver.rb
707
710
  - lib/cucumber/runtime/results.rb
@@ -743,6 +746,7 @@ files:
743
746
  - spec/cucumber/formatter/progress_spec.rb
744
747
  - spec/cucumber/formatter/spec_helper.rb
745
748
  - spec/cucumber/mappings_spec.rb
749
+ - spec/cucumber/multiline_argument/data_table_spec.rb
746
750
  - spec/cucumber/rake/forked_spec.rb
747
751
  - spec/cucumber/rb_support/rb_language_spec.rb
748
752
  - spec/cucumber/rb_support/rb_step_definition_spec.rb
@@ -792,7 +796,7 @@ rubyforge_project:
792
796
  rubygems_version: 2.0.14
793
797
  signing_key:
794
798
  specification_version: 4
795
- summary: cucumber-2.0.0.beta.2
799
+ summary: cucumber-2.0.0.beta.3
796
800
  test_files:
797
801
  - features/docs/api/list_step_defs_as_json.feature
798
802
  - features/docs/api/run_cli_main_with_existing_runtime.feature
@@ -841,6 +845,7 @@ test_files:
841
845
  - features/docs/gherkin/using_descriptions.feature
842
846
  - features/docs/gherkin/using_star_notation.feature
843
847
  - features/docs/iso-8859-1.feature
848
+ - features/docs/output_from_hooks.feature
844
849
  - features/docs/post_configuration_hook.feature
845
850
  - features/docs/profiles.feature
846
851
  - features/docs/rake_task.feature
@@ -852,6 +857,7 @@ test_files:
852
857
  - features/docs/wire_protocol_tags.feature
853
858
  - features/docs/wire_protocol_timeouts.feature
854
859
  - features/docs/work_in_progress.feature
860
+ - features/docs/writing_support_code/after_hooks.feature
855
861
  - features/docs/writing_support_code/around_hooks.feature
856
862
  - features/docs/writing_support_code/before_hook.feature
857
863
  - features/docs/writing_support_code/hook_order.feature
@@ -889,6 +895,7 @@ test_files:
889
895
  - spec/cucumber/formatter/progress_spec.rb
890
896
  - spec/cucumber/formatter/spec_helper.rb
891
897
  - spec/cucumber/mappings_spec.rb
898
+ - spec/cucumber/multiline_argument/data_table_spec.rb
892
899
  - spec/cucumber/rake/forked_spec.rb
893
900
  - spec/cucumber/rb_support/rb_language_spec.rb
894
901
  - spec/cucumber/rb_support/rb_step_definition_spec.rb
@@ -1,62 +0,0 @@
1
- require 'cucumber/errors'
2
-
3
- module Cucumber
4
- class Runtime
5
-
6
- class FeaturesLoader
7
- include Formatter::Duration
8
-
9
- def initialize(feature_files, filters, tag_expression)
10
- @feature_files, @filters, @tag_expression = feature_files, filters, tag_expression
11
- end
12
-
13
- def features
14
- load unless (defined? @features) and @features
15
- @features
16
- end
17
-
18
- private
19
-
20
- def load
21
- features = Ast::Features.new
22
-
23
- tag_counts = {}
24
- start = Time.new
25
- log.debug("Features:\n")
26
- @feature_files.each do |f|
27
- feature_file = FeatureFile.new(f)
28
- feature = feature_file.parse(@filters, tag_counts)
29
- if feature
30
- features.add_feature(feature)
31
- log.debug(" * #{f}\n")
32
- end
33
- end
34
- duration = Time.now - start
35
- log.debug("Parsing feature files took #{format_duration(duration)}\n\n")
36
-
37
- check_tag_limits(tag_counts)
38
-
39
- @features = features
40
- end
41
-
42
- def check_tag_limits(tag_counts)
43
- error_messages = []
44
- @tag_expression.limits.each do |tag_name, tag_limit|
45
- tag_locations = (tag_counts[tag_name] || [])
46
- tag_count = tag_locations.length
47
- if tag_count > tag_limit
48
- error = "#{tag_name} occurred #{tag_count} times, but the limit was set to #{tag_limit}\n " +
49
- tag_locations.join("\n ")
50
- error_messages << error
51
- end
52
- end
53
- raise TagExcess.new(error_messages) if error_messages.any?
54
- end
55
-
56
- def log
57
- Cucumber.logger
58
- end
59
- end
60
-
61
- end
62
- end