cucumber-core 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f3a3d2a1c3f4b18449225549d35fedcf56dde29
4
- data.tar.gz: d7ea03f3906eb56001fd04625875d17a45711680
3
+ metadata.gz: d0a8905410eaa2520b979eefe561fdd066e0c703
4
+ data.tar.gz: 882b6415e6c942bce875cbef62c3afadd5964dcc
5
5
  SHA512:
6
- metadata.gz: 066615ed100d54bf46fc955adc8bc7e1b52b4e9617d82247b436baf3138f05ada07afdeb4f1f5767787cb97fc4f299ddb03a09d48129f92cc79144e88257bb98
7
- data.tar.gz: 1a2e6cef1e122116f914087cb44b9e01884ea0c6de67c7c3fb045267db93fc37ff976e5c0aebf33db5540829ede1209512bfd5e341de3cd2b945d71c0a6f85ed
6
+ metadata.gz: b3f6a53c774b90832b8f6e86245a7107e4ebab450b8c7aa5d714309a7e3c367c60cbff5e06bbbfb67a6b2b8e853e2b32efbfef64f81dfe48b99d18ead9864132
7
+ data.tar.gz: 6e3c7953c11347def64e8fd184f3a2f11514ae24d1204c2ae9d52bb48518ab7a1fb1e6d15c3305e549c9c683af390b155d6c3888546dba970212499800ef5142
data/HISTORY.md CHANGED
@@ -1,4 +1,12 @@
1
- ## [In Git](https://github.com/cucumber/cucumber-ruby-core/compare/v1.1.1...master)
1
+ ## [In Git](https://github.com/cucumber/cucumber-ruby-core/compare/v1.1.3...master)
2
+
3
+ ## [v1.1.3](https://github.com/cucumber/cucumber-ruby-core/compare/v1.1.2...v1.1.2)
4
+
5
+ ### New Features
6
+
7
+ * Added custom `inspect` methods for AST Nodes (@tooky)
8
+
9
+ ## [v1.1.2](https://github.com/cucumber/cucumber-ruby-core/compare/v1.1.1...v1.1.2)
2
10
 
3
11
  ### New Features
4
12
 
@@ -17,6 +17,10 @@ module Cucumber
17
17
  def to_s
18
18
  value
19
19
  end
20
+
21
+ def inspect
22
+ %{#<#{self.class} #{value} (#{location})}
23
+ end
20
24
  end
21
25
  end
22
26
  end
@@ -91,7 +91,7 @@ module Cucumber
91
91
  end
92
92
 
93
93
  def inspect
94
- raw.inspect
94
+ %{#<#{self.class} #{raw.inspect} (#{location})>}
95
95
  end
96
96
 
97
97
  private
@@ -61,6 +61,15 @@ module Cucumber
61
61
  false
62
62
  end
63
63
 
64
+ def inspect
65
+ [
66
+ %{#<#{self.class} (#{location})},
67
+ %{ """#{content_type}},
68
+ %{ #{@content}},
69
+ %{ """>}
70
+ ].join("\n")
71
+ end
72
+
64
73
  private
65
74
 
66
75
  def description_for_visitors
@@ -5,6 +5,10 @@ module Cucumber
5
5
  def describe_to(*)
6
6
  self
7
7
  end
8
+
9
+ def inspect
10
+ "#<#{self.class.name}>"
11
+ end
8
12
  end
9
13
  end
10
14
  end
@@ -25,6 +25,10 @@ module Cucumber
25
25
  def to_sexp
26
26
  []
27
27
  end
28
+
29
+ def inspect
30
+ "#<#{self.class}>"
31
+ end
28
32
  end
29
33
  end
30
34
  end
@@ -52,6 +52,10 @@ module Cucumber
52
52
  def build_row(row_cells, number, location, language)
53
53
  Row.new(Hash[@cells.zip(row_cells)], number, location, language)
54
54
  end
55
+
56
+ def inspect
57
+ "#<#{self.class} #{values} (#{location})>"
58
+ end
55
59
  end
56
60
 
57
61
  class Row
@@ -88,7 +92,7 @@ module Cucumber
88
92
  end
89
93
 
90
94
  def inspect
91
- "#{self.class}: #{@data.inspect}"
95
+ "#<#{self.class}: #{@data.inspect} (#{location})>"
92
96
  end
93
97
 
94
98
  protected
@@ -22,6 +22,11 @@ module Cucumber
22
22
  def to_s
23
23
  @title
24
24
  end
25
+
26
+ def inspect
27
+ keyword_and_name = [keyword, name].join(": ")
28
+ %{#<#{self.class} "#{keyword_and_name}" (#{location})>}
29
+ end
25
30
  end
26
31
  end
27
32
  end
@@ -21,6 +21,11 @@ module Cucumber
21
21
  Ast::ExpandedOutlineStep.new(self, gherkin_statement, language, row.location, keyword, row.expand(name), replace_multiline_arg(row))
22
22
  end
23
23
 
24
+ def inspect
25
+ keyword_and_name = [keyword, name].join(": ")
26
+ %{#<#{self.class} "#{keyword_and_name}" (#{location})>}
27
+ end
28
+
24
29
  private
25
30
 
26
31
  def description_for_visitors
@@ -34,6 +34,11 @@ module Cucumber
34
34
  end
35
35
  end
36
36
 
37
+ def inspect
38
+ keyword_and_name = [keyword, name].join(": ")
39
+ %{#<#{self.class} "#{keyword_and_name}" (#{location})>}
40
+ end
41
+
37
42
  private
38
43
 
39
44
  def children
@@ -10,6 +10,10 @@ module Cucumber
10
10
  @location = location
11
11
  @name = name
12
12
  end
13
+
14
+ def inspect
15
+ %{#<#{self.class} "#{name}" (#{location})>}
16
+ end
13
17
  end
14
18
  end
15
19
  end
@@ -32,7 +32,7 @@ module Cucumber
32
32
  end
33
33
 
34
34
  def inspect
35
- "<#{self.class}: #{location}>"
35
+ "#<#{self.class}: #{location}>"
36
36
  end
37
37
 
38
38
  private
@@ -78,7 +78,7 @@ module Cucumber
78
78
  end
79
79
 
80
80
  def inspect
81
- "<#{self.class}: #{location}>"
81
+ "#<#{self.class}: #{location}>"
82
82
  end
83
83
 
84
84
  def feature
@@ -49,7 +49,7 @@ module Cucumber
49
49
  end
50
50
 
51
51
  def inspect
52
- "<#{self.class}: #{location}>"
52
+ "#<#{self.class}: #{location}>"
53
53
  end
54
54
 
55
55
  end
@@ -2,7 +2,7 @@ module Cucumber
2
2
  module Core
3
3
  class Version
4
4
  def self.to_s
5
- "1.1.2"
5
+ "1.1.3"
6
6
  end
7
7
  end
8
8
  end
@@ -0,0 +1,10 @@
1
+ require 'cucumber/core/ast/background'
2
+ module Cucumber::Core::Ast
3
+ describe Background do
4
+ it "has a useful inspect" do
5
+ location = Location.new("features/a_feature.feature", 3)
6
+ background = Background.new(double, double, location, double, "Background", "the name", double, [])
7
+ expect(background.inspect).to eq(%{#<Cucumber::Core::Ast::Background "Background: the name" (#{location})>})
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,6 @@
1
1
  require 'cucumber/core/ast/location'
2
2
  require 'cucumber/core/ast/doc_string'
3
+ require 'unindent'
3
4
 
4
5
  module Cucumber
5
6
  module Core
@@ -92,6 +93,21 @@ module Cucumber
92
93
  end
93
94
  end
94
95
  end
96
+
97
+ context "inspect" do
98
+ let(:location) { Location.new("features/feature.feature", 8) }
99
+ let(:content_type) { 'text/plain' }
100
+
101
+ it "provides a useful inspect method" do
102
+ doc_string = DocString.new("some text", content_type, location)
103
+ expect(doc_string.inspect).to eq <<-END.chomp.unindent
104
+ #<Cucumber::Core::Ast::DocString (features/feature.feature:8)
105
+ """text/plain
106
+ some text
107
+ """>
108
+ END
109
+ end
110
+ end
95
111
  end
96
112
  end
97
113
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-03-19 00:00:00.000000000 Z
15
+ date: 2015-03-25 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: gherkin
@@ -171,6 +171,7 @@ files:
171
171
  - lib/cucumber/core/version.rb
172
172
  - spec/capture_warnings.rb
173
173
  - spec/coverage.rb
174
+ - spec/cucumber/core/ast/background_spec.rb
174
175
  - spec/cucumber/core/ast/data_table_spec.rb
175
176
  - spec/cucumber/core/ast/doc_string_spec.rb
176
177
  - spec/cucumber/core/ast/empty_multiline_argument_spec.rb
@@ -217,10 +218,11 @@ rubyforge_project:
217
218
  rubygems_version: 2.2.2
218
219
  signing_key:
219
220
  specification_version: 4
220
- summary: cucumber-core-1.1.2
221
+ summary: cucumber-core-1.1.3
221
222
  test_files:
222
223
  - spec/capture_warnings.rb
223
224
  - spec/coverage.rb
225
+ - spec/cucumber/core/ast/background_spec.rb
224
226
  - spec/cucumber/core/ast/data_table_spec.rb
225
227
  - spec/cucumber/core/ast/doc_string_spec.rb
226
228
  - spec/cucumber/core/ast/empty_multiline_argument_spec.rb