cucumber-core 1.0.0.beta.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CONTRIBUTING.md +14 -0
  4. data/HISTORY.md +14 -1
  5. data/README.md +34 -33
  6. data/lib/cucumber/core.rb +3 -5
  7. data/lib/cucumber/core/ast/background.rb +13 -2
  8. data/lib/cucumber/core/ast/comment.rb +8 -2
  9. data/lib/cucumber/core/ast/examples_table.rb +14 -5
  10. data/lib/cucumber/core/ast/feature.rb +15 -6
  11. data/lib/cucumber/core/ast/scenario.rb +17 -4
  12. data/lib/cucumber/core/ast/scenario_outline.rb +20 -8
  13. data/lib/cucumber/core/ast/tag.rb +5 -3
  14. data/lib/cucumber/core/compiler.rb +39 -7
  15. data/lib/cucumber/core/filter.rb +83 -0
  16. data/lib/cucumber/core/gherkin/ast_builder.rb +7 -2
  17. data/lib/cucumber/core/gherkin/document.rb +5 -2
  18. data/lib/cucumber/core/gherkin/parser.rb +6 -1
  19. data/lib/cucumber/core/test/action.rb +8 -8
  20. data/lib/cucumber/core/test/around_hook.rb +19 -0
  21. data/lib/cucumber/core/test/case.rb +6 -4
  22. data/lib/cucumber/core/test/filters/locations_filter.rb +3 -6
  23. data/lib/cucumber/core/test/filters/name_filter.rb +3 -7
  24. data/lib/cucumber/core/test/filters/tag_filter.rb +4 -2
  25. data/lib/cucumber/core/test/result.rb +5 -7
  26. data/lib/cucumber/core/test/runner.rb +39 -40
  27. data/lib/cucumber/core/test/step.rb +7 -10
  28. data/lib/cucumber/core/version.rb +1 -1
  29. data/spec/capture_warnings.rb +5 -0
  30. data/spec/cucumber/core/filter_spec.rb +100 -0
  31. data/spec/cucumber/core/gherkin/parser_spec.rb +0 -1
  32. data/spec/cucumber/core/test/action_spec.rb +29 -31
  33. data/spec/cucumber/core/test/runner_spec.rb +5 -5
  34. data/spec/cucumber/core/test/step_spec.rb +18 -9
  35. data/spec/cucumber/core_spec.rb +40 -172
  36. metadata +11 -16
  37. data/lib/cucumber/core/test/hooks.rb +0 -93
  38. data/lib/cucumber/core/test/mapper.rb +0 -150
  39. data/lib/cucumber/initializer.rb +0 -18
  40. data/spec/cucumber/core/test/hooks_spec.rb +0 -30
  41. data/spec/cucumber/core/test/mapper_spec.rb +0 -203
  42. data/spec/cucumber/initializer_spec.rb +0 -49
@@ -1,49 +0,0 @@
1
- require 'cucumber/initializer'
2
-
3
- module Cucumber
4
- describe 'generating initializers' do
5
- class Book
6
- include Cucumber.initializer(:title, :author)
7
-
8
- def description
9
- "#{title} by #{author}"
10
- end
11
-
12
- def upcase!
13
- @title.upcase!
14
- @author.upcase!
15
- end
16
- end
17
-
18
- let(:cucumber_book) { Book.new('The Cucumber Book', 'Matt Wynne') }
19
-
20
- it 'raises an ArgumentError when initialized with the wrong number of arguments' do
21
- expect { Book.new() }.to raise_error(ArgumentError, 'wrong number of arguments (0 for 2)')
22
- end
23
-
24
- it 'creates a private reader for the attributes' do
25
- expect { cucumber_book.title }.to raise_error NoMethodError
26
- expect { cucumber_book.author }.to raise_error NoMethodError
27
- end
28
-
29
- it 'creates readers for the attributes' do
30
- expect( cucumber_book.description ).to eq 'The Cucumber Book by Matt Wynne'
31
- end
32
-
33
- it 'creates instance variables for the attributes' do
34
- cucumber_book.upcase!
35
- expect( cucumber_book.description ).to eq 'THE CUCUMBER BOOK by MATT WYNNE'
36
- end
37
-
38
- context 'with an overridden reader' do
39
- class Score
40
- include Cucumber.initializer(:score)
41
- attr_reader :score
42
- end
43
-
44
- it 'makes the reader public' do
45
- expect { Score.new(12).score }.to_not raise_error
46
- end
47
- end
48
- end
49
- end