gherkin 2.2.8 → 2.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ == 2.2.9 (2010-10-15)
2
+
3
+ === New Features
4
+ * PrettyFormatter can format features both with and without ANSI Colors. Using Jansi on Java. (Aslak Hellesøy)
5
+ * Extended Java Formatter API with a steps(List<Step>) method for better reporting in Java (Aslak Hellesøy)
6
+
1
7
  == 2.2.8 (2010-10-04)
2
8
 
3
9
  === Removed Features
@@ -9,7 +9,6 @@ Fast Gherkin lexer and parser based on Ragel. Gherkin is two things:
9
9
 
10
10
  You'll need MRI (any version) if you want to build for MRI. To build the Java implementation you'll need JRuby.
11
11
  You'll also need Ragel installed and on your PATH.
12
- Finally you'll need the jeweler gem. (Jeweler will tell you what other gems you need when you run rake)
13
12
 
14
13
  === MRI
15
14
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.8
1
+ 2.2.9
@@ -1,3 +1,3 @@
1
- default: --format pretty --tags ~@pending,~@wip --strict features
1
+ default: --format pretty --tags ~@pending,~@wip --strict --color features
2
2
  wip: --format pretty --tags @wip --wip features
3
3
  pending: --format pretty --tags @pending,~@native_lexer
@@ -2,6 +2,8 @@ require 'stringio'
2
2
  require 'gherkin/formatter/pretty_formatter'
3
3
  require 'gherkin/json_parser'
4
4
 
5
+ World(Gherkin::Formatter::Colors)
6
+
5
7
  Given /^a PrettyFormatter$/ do
6
8
  @io = StringIO.new
7
9
  @formatter = Gherkin::Formatter::PrettyFormatter.new(@io, true)
@@ -6,9 +6,11 @@ require 'gherkin/formatter/json_formatter'
6
6
  require 'gherkin/json_parser'
7
7
 
8
8
  module PrettyPlease
9
+ include Gherkin::Formatter::Colors
10
+
9
11
  def pretty_machinery(gherkin, feature_path)
10
12
  io = StringIO.new
11
- formatter = Gherkin::Formatter::PrettyFormatter.new(io, false)
13
+ formatter = Gherkin::Formatter::PrettyFormatter.new(io, true)
12
14
  parser = Gherkin::Parser::Parser.new(formatter, true)
13
15
  parse(parser, gherkin, feature_path)
14
16
  io.string
@@ -20,12 +22,12 @@ module PrettyPlease
20
22
  gherkin_parser = Gherkin::Parser::Parser.new(json_formatter, true)
21
23
  parse(gherkin_parser, gherkin, feature_path)
22
24
 
23
- result = StringIO.new
24
- pretty_formatter = Gherkin::Formatter::PrettyFormatter.new(result, false)
25
+ io = StringIO.new
26
+ pretty_formatter = Gherkin::Formatter::PrettyFormatter.new(io, true)
25
27
  json_parser = Gherkin::JSONParser.new(pretty_formatter)
26
28
  json_parser.parse(json.string, "#{feature_path}.json", 0)
27
29
 
28
- result.string
30
+ io.string
29
31
  end
30
32
 
31
33
  def parse(parser, gherkin, feature_path)
@@ -9,6 +9,7 @@ end
9
9
  require 'gherkin'
10
10
  require 'gherkin/sexp_recorder'
11
11
  require 'gherkin/output_stream_string_io'
12
+ require 'gherkin/java_libs'
12
13
  require 'gherkin/json'
13
14
 
14
15
  module TransformHelpers
@@ -1,2 +1,5 @@
1
1
  .idea
2
+ *.iml
3
+ *.iws
4
+ *.ipr
2
5
  target
@@ -4,24 +4,11 @@ module Gherkin
4
4
  module Formatter
5
5
  class Argument
6
6
  native_impl('gherkin')
7
- attr_reader :byte_offset, :val
7
+ attr_reader :offset, :val
8
8
 
9
- def initialize(byte_offset, val)
10
- @byte_offset, @val = byte_offset, val
11
- end
12
-
13
- def self.format(string, argument_format, arguments)
14
- arguments ||= []
15
- s = string.dup
16
- offset = past_offset = 0
17
- arguments.each do |arg|
18
- next if arg.byte_offset.nil? || arg.byte_offset < past_offset
19
- replacement = argument_format.format_argument(arg.val)
20
- s[arg.byte_offset + offset, arg.val.length] = replacement
21
- offset += replacement.unpack("U*").length - arg.val.unpack("U*").length
22
- past_offset = arg.byte_offset + arg.val.length
23
- end
24
- s
9
+ # Creates a new Argument that starts at character offset +offset+ with value +val+
10
+ def initialize(offset, val)
11
+ @offset, @val = offset, val
25
12
  end
26
13
  end
27
14
  end
@@ -65,14 +65,11 @@ module Gherkin
65
65
  ALIASES.each do |method, color|
66
66
  unless method =~ /.*_param/
67
67
  code = <<-EOF
68
- def #{method}(string=nil, monochrome=false, &proc)
69
- return string if monochrome
68
+ def #{method}(string=nil, &proc)
70
69
  #{ALIASES[method].split(",").join("(") + "(string, &proc" + ")" * ALIASES[method].split(",").length}
71
70
  end
72
- # This resets the colour to the non-param colour
73
- def #{method}_param(string=nil, monochrome=false, &proc)
74
- return string if monochrome
75
- #{ALIASES[method+'_param'].split(",").join("(") + "(string, &proc" + ")" * ALIASES[method+'_param'].split(",").length} + #{ALIASES[method].split(",").join(' + ')}
71
+ def #{method}_param(string=nil, &proc)
72
+ #{ALIASES[method+'_param'].split(",").join("(") + "(string, &proc" + ")" * ALIASES[method+'_param'].split(",").length}
76
73
  end
77
74
  EOF
78
75
  eval(code)
@@ -112,7 +109,7 @@ module Gherkin
112
109
  "\e[90m#{m}\e[0m"
113
110
  end
114
111
  end
115
-
112
+
116
113
  define_grey
117
114
  end
118
115
  end
@@ -150,6 +150,14 @@ module Gherkin
150
150
  formatter.step(self)
151
151
  end
152
152
 
153
+ def status
154
+ result ? result.status : 'undefined'
155
+ end
156
+
157
+ def arguments
158
+ result ? result.arguments : []
159
+ end
160
+
153
161
  def to_hash
154
162
  hash = super
155
163
  if Array === @multiline_arg
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require 'gherkin/formatter/colors'
3
- require 'gherkin/formatter/monochrome_format'
3
+ require 'gherkin/formatter/step_printer'
4
4
  require 'gherkin/formatter/argument'
5
5
  require 'gherkin/formatter/escaping'
6
6
  require 'gherkin/formatter/model'
@@ -14,10 +14,10 @@ module Gherkin
14
14
  include Colors
15
15
  include Escaping
16
16
 
17
- def initialize(io, monochrome)
17
+ def initialize(io, monochrome=false)
18
18
  @io = io
19
+ @step_printer = StepPrinter.new
19
20
  @monochrome = monochrome
20
- @format = MonochromeFormat.new #@monochrome ? MonochromeFormat.new : AnsiColorFormat.new
21
21
  end
22
22
 
23
23
  def uri(uri)
@@ -60,13 +60,7 @@ module Gherkin
60
60
  end
61
61
 
62
62
  def step(step)
63
- name = Gherkin::Formatter::Argument.format(step.name, @format, (step.result ? step.result.arguments : []))
64
-
65
- step_text = "#{step.keyword}#{step.name}"
66
- step_text = self.__send__(step.result.status, step_text, @monochrome) if step.result
67
-
68
- print_comments(step.comments, ' ')
69
- @io.puts(" #{step_text}#{indented_step_location!(step.result ? step.result.stepdef_location : nil)}")
63
+ print_step(step)
70
64
  case step.multiline_arg
71
65
  when Model::PyString
72
66
  py_string(step.multiline_arg)
@@ -75,13 +69,62 @@ module Gherkin
75
69
  end
76
70
  end
77
71
 
72
+ def print_step(step)
73
+ print_comments(step.comments, ' ')
74
+ @io.write(' ')
75
+ text_format(step).write_text(@io, step.keyword)
76
+ @step_printer.write_step(@io, text_format(step), arg_format(step), step.name, step.arguments)
77
+ print_indented_stepdef_location!(step.result.stepdef_location) if step.result
78
+ # TODO: Print error message
79
+ @io.puts
80
+ end
81
+
82
+ class MonochromeFormat
83
+ def write_text(io, text)
84
+ io.write(text)
85
+ end
86
+ end
87
+
88
+ class ColorFormat
89
+ include Colors
90
+
91
+ def initialize(status)
92
+ @status = status
93
+ end
94
+
95
+ def write_text(io, text)
96
+ io.write(self.__send__(@status, text))
97
+ end
98
+ end
99
+
100
+ def text_format(step)
101
+ format(step.status)
102
+ end
103
+
104
+ def arg_format(step)
105
+ format(step.status + '_param')
106
+ end
107
+
108
+ def format(key)
109
+ if @formats.nil?
110
+ if @monochrome
111
+ @formats = Hash.new(MonochromeFormat.new)
112
+ else
113
+ @formats = Hash.new do |formats, status|
114
+ formats[status] = ColorFormat.new(status)
115
+ end
116
+ end
117
+ end
118
+ @formats[key]
119
+ end
120
+
78
121
  def eof
79
122
  # NO-OP
80
123
  end
81
124
 
82
125
  # This method can be invoked before a #scenario, to ensure location arguments are aligned
83
126
  def steps(steps)
84
- @step_lengths = steps.map {|keyword, name| (keyword+name).unpack("U*").length}
127
+ @step_lengths = steps.map {|step| (step.keyword+step.name).unpack("U*").length}
85
128
  @max_step_length = @step_lengths.max
86
129
  @step_index = -1
87
130
  end
@@ -114,12 +157,12 @@ module Gherkin
114
157
 
115
158
  def exception(exception)
116
159
  exception_text = "#{exception.message} (#{exception.class})\n#{(exception.backtrace || []).join("\n")}".gsub(/^/, ' ')
117
- @io.puts(failed(exception_text, @monochrome))
160
+ @io.puts(failed(exception_text))
118
161
  end
119
162
 
120
163
  def color(cell, statuses, col)
121
164
  if statuses
122
- self.__send__(statuses[col], escape_cell(cell), @monochrome) + (@monochrome ? '' : reset)
165
+ self.__send__(statuses[col], escape_cell(cell)) + reset
123
166
  else
124
167
  escape_cell(cell)
125
168
  end
@@ -161,13 +204,13 @@ module Gherkin
161
204
  l = (keyword+name).unpack("U*").length
162
205
  @max_step_length = [@max_step_length, l].max
163
206
  indent = @max_step_length - l
164
- ' ' * indent + ' ' + comments("# #{@uri}:#{line}", @monochrome)
207
+ ' ' * indent + ' ' + comments("# #{@uri}:#{line}")
165
208
  end
166
209
 
167
- def indented_step_location!(location)
168
- return '' if location.nil?
210
+ def print_indented_stepdef_location!(location)
169
211
  indent = @max_step_length - @step_lengths[@step_index+=1]
170
- ' ' * indent + ' ' + comments("# #{location}", @monochrome)
212
+ return if location.nil?
213
+ @io.write(' ' * indent + ' ' + comments("# #{location}"))
171
214
  end
172
215
  end
173
216
  end
@@ -0,0 +1,17 @@
1
+ module Gherkin
2
+ module Formatter
3
+ class StepPrinter
4
+ def write_step(io, text_format, arg_format, step_name, arguments)
5
+ unpacked_step_name = step_name.unpack("U*")
6
+
7
+ text_start = 0
8
+ arguments.each do |arg|
9
+ text_format.write_text(io, unpacked_step_name[text_start..arg.offset-1].pack("U*")) unless arg.offset == 0
10
+ arg_format.write_text(io, arg.val)
11
+ text_start = arg.offset + arg.val.unpack("U*").length
12
+ end
13
+ text_format.write_text(io, unpacked_step_name[text_start..-1].pack("U*")) unless text_start == unpacked_step_name.length
14
+ end
15
+ end
16
+ end
17
+ end
@@ -57,7 +57,7 @@ module Gherkin
57
57
  require 'gherkin/formatter/pretty_formatter'
58
58
  require 'gherkin/formatter/model'
59
59
  io = defined?(JRUBY_VERSION) ? Java.java.io.StringWriter.new : StringIO.new
60
- pf = Gherkin::Formatter::PrettyFormatter.new(io, true)
60
+ pf = Gherkin::Formatter::PrettyFormatter.new(io)
61
61
  table = all.map do |i18n|
62
62
  Formatter::Model::Row.new([], [i18n.iso_code, i18n.keywords('name')[0], i18n.keywords('native')[0]], nil)
63
63
  end
@@ -149,7 +149,7 @@ module Gherkin
149
149
  require 'gherkin/formatter/pretty_formatter'
150
150
  require 'gherkin/formatter/model'
151
151
  io = StringIO.new
152
- pf = Gherkin::Formatter::PrettyFormatter.new(io, true)
152
+ pf = Gherkin::Formatter::PrettyFormatter.new(io)
153
153
 
154
154
  gherkin_keyword_table = KEYWORD_KEYS.map do |key|
155
155
  Formatter::Model::Row.new([], [key, keywords(key).map{|keyword| %{"#{keyword}"}}.join(', ')], nil)
@@ -11,7 +11,7 @@ module Gherkin
11
11
  end
12
12
 
13
13
  it "should be possible to specify no colouring" do
14
- failed("hello", true).should == "hello"
14
+ uncolored(failed("hello")).should == "hello"
15
15
  end
16
16
  end
17
17
  end
@@ -8,6 +8,8 @@ require 'gherkin/formatter/pretty_formatter'
8
8
  module Gherkin
9
9
  module Formatter
10
10
  describe FilterFormatter do
11
+ include Colors
12
+
11
13
  attr_accessor :file
12
14
 
13
15
  before do
@@ -9,19 +9,22 @@ require 'stringio'
9
9
  module Gherkin
10
10
  module Formatter
11
11
  describe PrettyFormatter do
12
+ include Colors
13
+
12
14
  def assert_io(s)
13
15
  actual = @io.string
16
+ actual.gsub!(/\e\[m/, "\e[0m") # JANSI resets without the 0.
14
17
  actual.should == s
15
18
  end
16
19
 
17
- def assert_pretty(input, output=input)
20
+ def assert_pretty(input, expected_output=input)
18
21
  [true, false].each do |force_ruby|
19
22
  io = StringIO.new
20
23
  pf = Gherkin::Formatter::PrettyFormatter.new(io, true)
21
24
  parser = Gherkin::Parser::Parser.new(pf, true, "root", force_ruby)
22
25
  parser.parse(input, "test.feature", 0)
23
- actual = io.string
24
- actual.should == output
26
+ output = io.string
27
+ output.should == expected_output
25
28
  end
26
29
  end
27
30
 
@@ -31,50 +34,54 @@ module Gherkin
31
34
 
32
35
  before do
33
36
  @io = StringIO.new
34
- @l = Gherkin::Formatter::PrettyFormatter.new(@io, true)
37
+ @colf = Gherkin::Formatter::PrettyFormatter.new(@io, false)
35
38
  end
36
39
 
37
40
  it "should print comments when scenario is longer" do
38
- @l.uri("features/foo.feature")
39
- @l.feature(Model::Feature.new([], [], "Feature", "Hello", "World", 1))
40
- @l.steps([
41
- ['Given ', 'some stuff'],
42
- ['When ', 'foo']
43
- ])
44
- @l.scenario(Model::Scenario.new([], [], "Scenario", "The scenario", "", 4))
45
- @l.step(Model::Step.new([], "Given ", "some stuff", 5, nil, result('passed', nil, nil, "features/step_definitions/bar.rb:56")))
46
- @l.step(Model::Step.new([], "When ", "foo", 6, nil, result('passed', nil, nil, "features/step_definitions/bar.rb:96")))
41
+ @colf.uri("features/foo.feature")
42
+ @colf.feature(Model::Feature.new([], [], "Feature", "Hello", "World", 1))
43
+ step1 = Model::Step.new([], "Given ", "some stuff", 5, nil, result('passed', nil, [], "features/step_definitions/bar.rb:56"))
44
+ step2 = Model::Step.new([], "When ", "foo", 6, nil, result('passed', nil, [], "features/step_definitions/bar.rb:96"))
45
+ @colf.steps([step1, step2])
46
+ @colf.scenario(Model::Scenario.new([], [], "Scenario", "The scenario", "", 4))
47
+ @colf.step(step1)
48
+ @colf.step(step2)
47
49
 
48
50
  assert_io(%{Feature: Hello
49
51
  World
50
52
 
51
- Scenario: The scenario # features/foo.feature:4
52
- Given some stuff # features/step_definitions/bar.rb:56
53
- When foo # features/step_definitions/bar.rb:96
53
+ Scenario: The scenario #{grey('# features/foo.feature:4')}
54
+ #{green('Given ')}#{green('some stuff')} #{grey('# features/step_definitions/bar.rb:56')}
55
+ #{green('When ')}#{green('foo')} #{grey('# features/step_definitions/bar.rb:96')}
54
56
  })
55
57
  end
56
58
 
57
59
  it "should print comments when step is longer" do
58
- @l.uri("features/foo.feature")
59
- @l.feature(Model::Feature.new([], [], "Feature", "Hello", "World", 1))
60
- @l.steps([
61
- ['Given ', 'some stuff that is longer']
62
- ])
63
- @l.scenario(Model::Scenario.new([], [], "Scenario", "The scenario", "", 4))
64
- @l.step(Model::Step.new([], "Given ", "some stuff that is longer", 5, nil, result('passed', nil, nil, "features/step_definitions/bar.rb:56")))
60
+ @colf.uri("features/foo.feature")
61
+ @colf.feature(Model::Feature.new([], [], "Feature", "Hello", "World", 1))
62
+ step = Model::Step.new([], "Given ", "some stuff that is longer", 5, nil, result('passed', nil, [], "features/step_definitions/bar.rb:56"))
63
+ @colf.steps([step])
64
+ @colf.scenario(Model::Scenario.new([], [], "Scenario", "The scenario", "", 4))
65
+ @colf.step(step)
65
66
 
66
67
  assert_io(%{Feature: Hello
67
68
  World
68
69
 
69
- Scenario: The scenario # features/foo.feature:4
70
- Given some stuff that is longer # features/step_definitions/bar.rb:56
70
+ Scenario: The scenario #{grey('# features/foo.feature:4')}
71
+ #{green('Given ')}#{green('some stuff that is longer')} #{grey('# features/step_definitions/bar.rb:56')}
71
72
  })
72
73
  end
73
74
 
74
75
  it "should highlight arguments for regular steps" do
75
76
  step = Model::Step.new([], "Given ", "I have 999 cukes in my belly", 3, nil, result('passed', nil, [Gherkin::Formatter::Argument.new(7, '999')], nil))
76
- @l.step(step)
77
- assert_io(" Given I have 999 cukes in my belly\n")
77
+ @colf.steps([step])
78
+ @colf.step(step)
79
+ if defined?(JRUBY_VERSION)
80
+ # Not terribly readable. The result on Java is different because JANSI uses semicolons when there are several codes.
81
+ assert_io(" \e[32mGiven \e[0m\e[32mI have \e[0m\e[32;1m999\e[0m\e[32m cukes in my belly\e[0m\n")
82
+ else
83
+ assert_io(" #{green('Given ')}#{green('I have ')}#{green(bold('999'))}#{green(' cukes in my belly')}\n")
84
+ end
78
85
  end
79
86
 
80
87
  it "should prettify scenario" do
@@ -0,0 +1,55 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require 'gherkin/formatter/step_printer'
4
+ require 'gherkin/formatter/argument'
5
+ require 'stringio'
6
+
7
+ module Gherkin
8
+ module Formatter
9
+ class ParenthesisFormat
10
+ def write_text(io, text)
11
+ io.write("(#{text})")
12
+ end
13
+ end
14
+
15
+ class BracketFormat
16
+ def write_text(io, text)
17
+ io.write("[#{text}]")
18
+ end
19
+ end
20
+
21
+ describe StepPrinter do
22
+ before do
23
+ @io = StringIO.new
24
+ @p = StepPrinter.new
25
+ @pf = ParenthesisFormat.new
26
+ @bf = BracketFormat.new
27
+ end
28
+
29
+ it "should replace 0 args" do
30
+ @p.write_step(@io, @pf, @bf, "I have 10 cukes", [])
31
+ @io.string.should == "(I have 10 cukes)"
32
+ end
33
+
34
+ it "should replace 1 arg" do
35
+ @p.write_step(@io, @pf, @bf, "I have 10 cukes", [Argument.new(7, '10')])
36
+ @io.string.should == "(I have )[10]( cukes)"
37
+ end
38
+
39
+ it "should replace 1 unicode arg" do
40
+ @p.write_step(@io, @pf, @bf, "I hæve øæ cåkes", [Argument.new(7, 'øæ')])
41
+ @io.string.should == "(I hæve )[øæ]( cåkes)"
42
+ end
43
+
44
+ it "should replace 2 args" do
45
+ @p.write_step(@io, @pf, @bf, "I have 10 yellow cukes in my belly", [Argument.new(7, '10'), Argument.new(17, 'cukes')])
46
+ @io.string.should == "(I have )[10]( yellow )[cukes]( in my belly)"
47
+ end
48
+
49
+ it "should replace 2 unicode args" do
50
+ @p.write_step(@io, @pf, @bf, "Æslåk likes æøå", [Argument.new(0, 'Æslåk'), Argument.new(12, 'æøå')])
51
+ @io.string.should == "[Æslåk]( likes )[æøå]"
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,13 @@
1
+ if defined?(JRUBY_VERSION)
2
+ require 'rexml/document'
3
+ pom = REXML::Document.new(IO.read(File.dirname(__FILE__) + '/../../java/pom.xml'))
4
+ pom_version = REXML::XPath.first(pom, '//xmlns:project/xmlns:version/text()').to_s
5
+ REXML::XPath.each(pom, '//xmlns:project/xmlns:dependencies/xmlns:dependency').each do |dep|
6
+ groupId = dep.get_elements('groupId')[0].text()
7
+ artifactId = dep.get_elements('artifactId')[0].text()
8
+ version = dep.get_elements('version')[0].text()
9
+
10
+ jar = "~/.m2/repository/#{groupId.gsub(/\./, '/')}/#{artifactId}/#{version}/#{artifactId}-#{version}.jar"
11
+ require jar
12
+ end
13
+ end
@@ -1,15 +1,11 @@
1
1
  if defined?(JRUBY_VERSION)
2
- class OutputStreamStringIO < Java.java.io.ByteArrayOutputStream
2
+ class WriterStringIO < Java.java.io.StringWriter
3
3
  def write(what)
4
- if String === what
5
- super(Java.java.lang.String.new(what).getBytes("UTF-8"))
6
- else
7
- super(what)
8
- end
4
+ super(Java.java.lang.String.new(what.to_s))
9
5
  end
10
6
 
11
7
  def string
12
- toString("UTF-8")
8
+ toString()
13
9
  end
14
10
  end
15
11
 
@@ -17,7 +13,7 @@ if defined?(JRUBY_VERSION)
17
13
  class StringIO
18
14
  class << self
19
15
  def new
20
- OutputStreamStringIO.new
16
+ WriterStringIO.new
21
17
  end
22
18
  end
23
19
  end
@@ -6,6 +6,7 @@ require 'gherkin'
6
6
  require 'stringio'
7
7
  require 'gherkin/sexp_recorder'
8
8
  require 'gherkin/output_stream_string_io'
9
+ require 'gherkin/java_libs'
9
10
  require 'gherkin/json'
10
11
  require 'gherkin/shared/lexer_group'
11
12
  require 'gherkin/shared/tags_group'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 2
8
- - 8
9
- version: 2.2.8
8
+ - 9
9
+ version: 2.2.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mike Sassak
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-04 00:00:00 +02:00
19
+ date: 2010-10-15 00:00:00 +02:00
20
20
  default_executable: gherkin
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -223,9 +223,9 @@ files:
223
223
  - lib/gherkin/formatter/json_formatter.rb
224
224
  - lib/gherkin/formatter/line_filter.rb
225
225
  - lib/gherkin/formatter/model.rb
226
- - lib/gherkin/formatter/monochrome_format.rb
227
226
  - lib/gherkin/formatter/pretty_formatter.rb
228
227
  - lib/gherkin/formatter/regexp_filter.rb
228
+ - lib/gherkin/formatter/step_printer.rb
229
229
  - lib/gherkin/formatter/tag_count_formatter.rb
230
230
  - lib/gherkin/formatter/tag_filter.rb
231
231
  - lib/gherkin/i18n.rb
@@ -270,16 +270,17 @@ files:
270
270
  - spec/gherkin/fixtures/simple_with_comments.feature
271
271
  - spec/gherkin/fixtures/simple_with_tags.feature
272
272
  - spec/gherkin/fixtures/with_bom.feature
273
- - spec/gherkin/formatter/argument_spec.rb
274
273
  - spec/gherkin/formatter/colors_spec.rb
275
274
  - spec/gherkin/formatter/filter_formatter_spec.rb
276
275
  - spec/gherkin/formatter/model_spec.rb
277
276
  - spec/gherkin/formatter/pretty_formatter_spec.rb
278
277
  - spec/gherkin/formatter/spaces.feature
278
+ - spec/gherkin/formatter/step_printer_spec.rb
279
279
  - spec/gherkin/formatter/tabs.feature
280
280
  - spec/gherkin/formatter/tag_count_formatter_spec.rb
281
281
  - spec/gherkin/i18n_spec.rb
282
282
  - spec/gherkin/java_lexer_spec.rb
283
+ - spec/gherkin/java_libs.rb
283
284
  - spec/gherkin/json.rb
284
285
  - spec/gherkin/json_parser_spec.rb
285
286
  - spec/gherkin/lexer/i18n_lexer_spec.rb
@@ -454,7 +455,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
454
455
  requirements:
455
456
  - - ">="
456
457
  - !ruby/object:Gem::Version
457
- hash: -4414543502464709152
458
+ hash: -372096980978635537
458
459
  segments:
459
460
  - 0
460
461
  version: "0"
@@ -463,7 +464,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
463
464
  requirements:
464
465
  - - ">="
465
466
  - !ruby/object:Gem::Version
466
- hash: -4414543502464709152
467
+ hash: -372096980978635537
467
468
  segments:
468
469
  - 0
469
470
  version: "0"
@@ -473,7 +474,7 @@ rubyforge_project:
473
474
  rubygems_version: 1.3.7
474
475
  signing_key:
475
476
  specification_version: 3
476
- summary: gherkin-2.2.8
477
+ summary: gherkin-2.2.9
477
478
  test_files:
478
479
  - features/escaped_pipes.feature
479
480
  - features/feature_parser.feature
@@ -506,16 +507,17 @@ test_files:
506
507
  - spec/gherkin/fixtures/simple_with_comments.feature
507
508
  - spec/gherkin/fixtures/simple_with_tags.feature
508
509
  - spec/gherkin/fixtures/with_bom.feature
509
- - spec/gherkin/formatter/argument_spec.rb
510
510
  - spec/gherkin/formatter/colors_spec.rb
511
511
  - spec/gherkin/formatter/filter_formatter_spec.rb
512
512
  - spec/gherkin/formatter/model_spec.rb
513
513
  - spec/gherkin/formatter/pretty_formatter_spec.rb
514
514
  - spec/gherkin/formatter/spaces.feature
515
+ - spec/gherkin/formatter/step_printer_spec.rb
515
516
  - spec/gherkin/formatter/tabs.feature
516
517
  - spec/gherkin/formatter/tag_count_formatter_spec.rb
517
518
  - spec/gherkin/i18n_spec.rb
518
519
  - spec/gherkin/java_lexer_spec.rb
520
+ - spec/gherkin/java_libs.rb
519
521
  - spec/gherkin/json.rb
520
522
  - spec/gherkin/json_parser_spec.rb
521
523
  - spec/gherkin/lexer/i18n_lexer_spec.rb
@@ -1,9 +0,0 @@
1
- module Gherkin
2
- module Formatter
3
- class MonochromeFormat
4
- def format_argument(arg)
5
- arg
6
- end
7
- end
8
- end
9
- end
@@ -1,28 +0,0 @@
1
- # encoding: utf-8
2
- require 'spec_helper'
3
- require 'gherkin/formatter/argument'
4
-
5
- module Gherkin
6
- module Formatter
7
- class BracketFormat
8
- class << self
9
- def new
10
- defined?(JRUBY_VERSION) ? ::Java::GherkinFormatter::ArgumentFormat.new("[", "]") : super
11
- end
12
- end
13
-
14
- def format_argument(s)
15
- "[#{s}]"
16
- end
17
- end
18
-
19
- describe Argument do
20
- it "should replace one arg" do
21
- argument_class = defined?(JRUBY_VERSION) ? ::Java::GherkinFormatter::Argument : Gherkin::Formatter::Argument
22
- argument_class.format("I have 10 cukes", Gherkin::Formatter::BracketFormat.new, [Gherkin::Formatter::Argument.new(7, '10')]).should == "I have [10] cukes"
23
- end
24
-
25
- # TODO: Add this spec: http://github.com/alg/cucumber/commit/33188e9db51f59ced74c4861524d7b2e69454630
26
- end
27
- end
28
- end