Sha256: 12e7d3fc8a7ca26a308b0c4fc7b844bf55f93f70cd5e12f6e3f920c00b1dae3f

Contents?: true

Size: 549 Bytes

Versions: 2

Compression:

Stored size: 549 Bytes

Contents

require 'fitting/statistics/template'

module Fitting
  class Tests
    def initialize(tested_requests)
      @tested_requests = tested_requests
    end

    def save
      array = @tested_requests.inject([]) do |res, request|
        next res unless request.path.to_s.start_with?(Fitting.configuration.prefix)
        res.push(request.to_spherical.to_hash)
      end
      json = JSON.dump(array)
      File.open('tests.json', 'w') { |file| file.write(json) }
    end

    def make_dir(dir_name)
      FileUtils.mkdir_p(dir_name)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fitting-2.8.0 lib/fitting/tests.rb
fitting-2.7.2 lib/fitting/tests.rb