Sha256: 79c1f92ce9211695a27d29b5a71b885d96f441e4db4f0174b50f46aca28e40ba

Contents?: true

Size: 536 Bytes

Versions: 4

Compression:

Stored size: 536 Bytes

Contents

require 'fitting/statistics/template'

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

    def save
      make_dir('fitting_tests')
      array = @tested_requests.inject([]) do |res, request|
        res.push(request.to_spherical.to_hash)
      end
      json = JSON.dump(array)

      File.open("fitting_tests/test#{ENV['TEST_ENV_NUMBER']}.json", 'w') { |file| file.write(json) }
    end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fitting-2.18.3 lib/fitting/tests.rb
fitting-2.18.2 lib/fitting/tests.rb
fitting-2.18.1 lib/fitting/tests.rb
fitting-2.18.0 lib/fitting/tests.rb