Sha256: 0f1808da6ecdc0031e28888d19a3d32e0816dd82774dea1cdf84d3b84d26ac77

Contents?: true

Size: 630 Bytes

Versions: 13

Compression:

Stored size: 630 Bytes

Contents

$:.unshift File.expand_path('../../lib', __FILE__)
require 'stackprof'
require 'minitest/autorun'

class ReportDumpTest < MiniTest::Test
  require 'stringio'

  def test_dump_to_stdout
    data = {}
    report = StackProf::Report.new(data)

    out, _err = capture_subprocess_io do
      report.print_dump
    end

    assert_dump data, out
  end

  def test_dump_to_file
    data = {}
    f = StringIO.new
    report = StackProf::Report.new(data)

    report.print_dump(f)

    assert_dump data, f.string
  end

  private

  def assert_dump(expected, marshal_data)
    assert_equal expected, Marshal.load(marshal_data)
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
stackprof-0.2.19 test/test_report.rb
stackprof-0.2.18 test/test_report.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/stackprof-0.2.17/test/test_report.rb
stackprof-0.2.17 test/test_report.rb
stackprof-0.2.16 test/test_report.rb
stackprof-0.2.15 test/test_report.rb
stackprof-0.2.14 test/test_report.rb
stackprof-0.2.13 test/test_report.rb
stackprof-0.2.12 test/test_report.rb
stackprof-0.2.11 test/test_report.rb
stackprof-0.2.10 test/test_report.rb
stackprof-0.2.9 test/test_report.rb
stackprof-0.2.8 test/test_report.rb