Sha256: 7f95b6ac10f162f95939a711ff126eae88ed4081acb98635df045cba4dc611a3

Contents?: true

Size: 848 Bytes

Versions: 89

Compression:

Stored size: 848 Bytes

Contents

# encoding: utf-8
require 'spec_helper'
require 'gherkin/formatter/argument'

module Gherkin
  module Formatter
    class BracketFormat
      class << self
        def new
          defined?(JRUBY_VERSION) ? ::Java::GherkinFormatter::ArgumentFormat.new("[", "]") : super
        end
      end

      def format_argument(s)
        "[#{s}]"
      end
    end
    
    describe Argument do
      it "should replace one arg" do
        argument_class = defined?(JRUBY_VERSION) ? ::Java::GherkinFormatter::Argument : Gherkin::Formatter::Argument
        argument_class.format("I have 10 cukes", Gherkin::Formatter::BracketFormat.new, [Gherkin::Formatter::Argument.new(7, '10')]).should == "I have [10] cukes"
      end
      
      # TODO: Add this spec: http://github.com/alg/cucumber/commit/33188e9db51f59ced74c4861524d7b2e69454630
    end
  end
end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
gherkin-2.2.8 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.8-x86-mswin32 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.8-x86-mingw32 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.8-universal-dotnet spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.8-java spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.7 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.7-x86-mswin32 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.7-x86-mingw32 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.7-universal-dotnet spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.7-java spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.6 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.6-x86-mswin32 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.6-x86-mingw32 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.6-universal-dotnet spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.6-java spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.5 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.5-x86-mswin32 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.5-x86-mingw32 spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.5-universal-dotnet spec/gherkin/formatter/argument_spec.rb
gherkin-2.2.5-java spec/gherkin/formatter/argument_spec.rb