Sha256: 438afc3cccd8d4f3c706a01ca3def6610007907a08d69fea22c53a506dfabf82

Contents?: true

Size: 724 Bytes

Versions: 9

Compression:

Stored size: 724 Bytes

Contents

require 'cucumber/formatter/gherkin_formatter_adapter'
require 'cucumber/formatter/io'
require 'gherkin/formatter/argument'
require 'gherkin/formatter/json_formatter'

module Cucumber
  module Formatter
    # The formatter used for <tt>--format json</tt>
    class Json < GherkinFormatterAdapter
      include Io

      def initialize(step_mother, io, options)
        @io = ensure_io(io, "json")
        @io.write('{"features":[')
        super(Gherkin::Formatter::JSONFormatter.new(@io), false)
      end

      def before_feature(feature)
        super
        @io.write(',') if @one
        @one = true
      end

      def after_features(features)
        @io.write(']}')
        @io.flush
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
casecumber-1.0.2.1 lib/cucumber/formatter/json.rb
js-log-cucumber-1.0.2 lib/cucumber/formatter/json.rb
cucumber-1.1.0 lib/cucumber/formatter/json.rb
cucumber-1.0.6 lib/cucumber/formatter/json.rb
cucumber-1.0.5 lib/cucumber/formatter/json.rb
cucumber-1.0.4 lib/cucumber/formatter/json.rb
cucumber-1.0.3 lib/cucumber/formatter/json.rb
cucumber-1.0.2 lib/cucumber/formatter/json.rb
cucumber-1.0.1 lib/cucumber/formatter/json.rb