Sha256: 4e5ebec11bfb140011b16ee3b1379692a0ea53bbc71e5ee7d39a4358ad0e0e74

Contents?: true

Size: 838 Bytes

Versions: 109

Compression:

Stored size: 838 Bytes

Contents

# encoding: utf-8
require File.expand_path(File.dirname(__FILE__) + '/../../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 : Argument
        argument_class.format("I have 10 cukes", BracketFormat.new, [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

109 entries across 109 versions & 1 rubygems

Version Path
gherkin-1.0.30 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.30-i386-mswin32 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.30-i386-mingw32 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.30-universal-dotnet spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.30-java spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.29 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.29-i386-mswin32 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.29-i386-mingw32 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.29-java spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.28 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.28-i386-mswin32 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.28-i386-mingw32 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.28-java spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.27 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.27-i386-mswin32 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.27-i386-mingw32 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.27-java spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.26 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.26-i386-mswin32 spec/gherkin/formatter/argument_spec.rb
gherkin-1.0.26-i386-mingw32 spec/gherkin/formatter/argument_spec.rb