Sha256: c6442efdcddfa2fb4632ae9d451ad0f2b16b6621cccd06bba23f76fed0b9174c

Contents?: true

Size: 550 Bytes

Versions: 3

Compression:

Stored size: 550 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

3 entries across 3 versions & 1 rubygems

Version Path
fitting-2.7.1 lib/fitting/tests.rb
fitting-2.7.0 lib/fitting/tests.rb
fitting-2.6.0 lib/fitting/tests.rb