Sha256: e5ce9fe66ec34672280a147ed039352ea01b0681b6721ac5829ec46bdd02255a

Contents?: true

Size: 1.05 KB

Versions: 63

Compression:

Stored size: 1.05 KB

Contents

require 'helper'

class TestFileList < Test::Unit::TestCase
  on_ruby "1.9" do
    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, 1, 1, 1, nil, nil, 1, 0, nil, nil]}
        @file_list = SimpleCov::Result.new(original_result).files
      end

      should("have 13 covered_lines") { assert_equal 13, @file_list.covered_lines }
      should("have 2 missed_lines")   { assert_equal 2, @file_list.missed_lines }
      should("have 18 never_lines")   { assert_equal 18, @file_list.never_lines }
      should("have 15 lines_of_code") { assert_equal 15, @file_list.lines_of_code }
      should("have 3 skipped_lines")  { assert_equal 3, @file_list.skipped_lines }

      should "have correct covered_percent" do
        assert_equal 100.0*13/15, @file_list.covered_percent
      end
    end
  end
end

Version data entries

63 entries across 48 versions & 6 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/simplecov-0.7.1/test/test_file_list.rb
candlepin-api-0.4.0 bundle/ruby/gems/simplecov-0.7.1/test/test_file_list.rb
challah-1.0.0 vendor/bundle/gems/simplecov-0.7.1/test/test_file_list.rb
challah-1.0.0.beta3 vendor/bundle/gems/simplecov-0.7.1/test/test_file_list.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/simplecov-0.7.1/test/test_file_list.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/simplecov-0.7.1/test/test_file_list.rb
challah-1.0.0.beta2 vendor/bundle/gems/simplecov-0.7.1/test/test_file_list.rb
challah-1.0.0.beta vendor/bundle/gems/simplecov-0.7.1/test/test_file_list.rb
challah-0.9.1.beta.3 vendor/bundle/gems/simplecov-0.7.1/test/test_file_list.rb
devise_sociable-0.1.0 vendor/bundle/gems/simplecov-0.7.1/test/test_file_list.rb
challah-0.9.1.beta vendor/bundle/gems/simplecov-0.7.1/test/test_file_list.rb
challah-0.9.0 vendor/bundle/gems/simplecov-0.7.1/test/test_file_list.rb
challah-rolls-0.2.0 vendor/bundle/gems/simplecov-0.6.4/test/test_file_list.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/simplecov-0.6.4/test/test_file_list.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/simplecov-0.6.4/test/test_file_list.rb
challah-rolls-0.2.0 vendor/bundle/gems/simplecov-0.7.1/test/test_file_list.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/simplecov-0.7.1/test/test_file_list.rb
challah-0.8.3 vendor/bundle/gems/simplecov-0.6.4/test/test_file_list.rb
challah-0.8.3 vendor/bundle/gems/simplecov-0.7.1/test/test_file_list.rb
simplecov-0.7.1 test/test_file_list.rb