Sha256: 3387d43900a09970dd351acc6bd69f143948319ea76ab870e49920169267cfd1

Contents?: true

Size: 708 Bytes

Versions: 10

Compression:

Stored size: 708 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")
        @obj = {'features' => []}
        super(Gherkin::Formatter::JSONFormatter.new(nil), false)
      end

      def after_feature(feature)
        super
        @obj['features'] << @gf.gherkin_object
      end

      def after_features(features)
        @io.write(@obj.to_json)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
cucumber-1.0.0 lib/cucumber/formatter/json.rb
cucumber-0.8.6 lib/cucumber/formatter/json.rb
cucumber-0.10.7 lib/cucumber/formatter/json.rb
cucumber-0.10.6 lib/cucumber/formatter/json.rb
cucumber-0.10.5 lib/cucumber/formatter/json.rb
cucumber-0.10.3 lib/cucumber/formatter/json.rb
cucumber-0.10.2 lib/cucumber/formatter/json.rb
cucumber-0.10.1 lib/cucumber/formatter/json.rb
stefl-cucumber-0.10.1 lib/cucumber/formatter/json.rb
cucumber-0.10.0 lib/cucumber/formatter/json.rb