Sha256: 97e9a78e9fe0e0a4617a85b711e679f4f15d20bd2849552357b11807ebba14bd

Contents?: true

Size: 1.11 KB

Versions: 11

Compression:

Stored size: 1.11 KB

Contents

require 'helper'

class TestFileList < Test::Unit::TestCase
  context "With a file list from a result" do
    setup do
      original_result = {source_fixture('sample.rb') => [nil, 1, 1, 1, nil, nil, 1, 1, nil, nil],
          source_fixture('app/models/user.rb') => [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil],
          source_fixture('app/controllers/sample_controller.rb') => [nil, 2, 2, 0, nil, nil, 0, nil, nil, nil]}
      @file_list = SimpleCov::Result.new(original_result).files
    end

    should("have 11 covered_lines") { assert_equal 11, @file_list.covered_lines }
    should("have 3 missed_lines")   { assert_equal 3, @file_list.missed_lines }
    should("have 19 never_lines")   { assert_equal 19, @file_list.never_lines }
    should("have 14 lines_of_code") { assert_equal 14, @file_list.lines_of_code }
    should("have 3 skipped_lines")  { assert_equal 3, @file_list.skipped_lines }

    should("have correct covered_percent") { assert_equal 100.0*11/14, @file_list.covered_percent }
    should("have correct covered_strength") { assert_equal 13.to_f/14, @file_list.covered_strength }
  end
end if SimpleCov.usable?

Version data entries

11 entries across 6 versions & 3 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/simplecov-0.9.0/test/test_file_list.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/simplecov-0.9.0/test/test_file_list.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/simplecov-0.9.0/test/test_file_list.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/simplecov-0.8.2/test/test_file_list.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/simplecov-0.8.2/test/test_file_list.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/simplecov-0.8.2/test/test_file_list.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/simplecov-0.8.2/test/test_file_list.rb
simplecov-0.9.1 test/test_file_list.rb
simplecov-0.9.0 test/test_file_list.rb
simplecov-0.8.2 test/test_file_list.rb
simplecov-0.8.1 test/test_file_list.rb