coverband 4.2.5.rc.2 → 5.0.0.rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.standard.yml +25 -0
  3. data/.travis.yml +2 -1
  4. data/Gemfile +5 -7
  5. data/Gemfile.rails4 +0 -3
  6. data/Gemfile.rails6 +0 -3
  7. data/README.md +24 -77
  8. data/Rakefile +17 -17
  9. data/changes.md +26 -30
  10. data/config.ru +1 -1
  11. data/coverband.gemspec +29 -34
  12. data/lib/alternative_coverband_patch.rb +5 -0
  13. data/lib/coverband.rb +55 -43
  14. data/lib/coverband/adapters/base.rb +17 -17
  15. data/lib/coverband/adapters/file_store.rb +2 -2
  16. data/lib/coverband/adapters/hash_redis_store.rb +24 -21
  17. data/lib/coverband/adapters/redis_store.rb +12 -12
  18. data/lib/coverband/at_exit.rb +1 -1
  19. data/lib/coverband/collectors/coverage.rb +15 -27
  20. data/lib/coverband/collectors/delta.rb +19 -9
  21. data/lib/coverband/collectors/view_tracker.rb +19 -11
  22. data/lib/coverband/configuration.rb +48 -84
  23. data/lib/coverband/integrations/background.rb +3 -3
  24. data/lib/coverband/integrations/rack_server_check.rb +3 -3
  25. data/lib/coverband/integrations/resque.rb +13 -1
  26. data/lib/coverband/reporters/base.rb +10 -10
  27. data/lib/coverband/reporters/console_report.rb +1 -1
  28. data/lib/coverband/reporters/html_report.rb +10 -30
  29. data/lib/coverband/reporters/web.rb +56 -49
  30. data/lib/coverband/utils/absolute_file_converter.rb +6 -6
  31. data/lib/coverband/utils/html_formatter.rb +32 -61
  32. data/lib/coverband/utils/railtie.rb +16 -4
  33. data/lib/coverband/utils/relative_file_converter.rb +2 -2
  34. data/lib/coverband/utils/result.rb +6 -11
  35. data/lib/coverband/utils/results.rb +0 -10
  36. data/lib/coverband/utils/source_file.rb +21 -30
  37. data/lib/coverband/utils/tasks.rb +7 -11
  38. data/lib/coverband/version.rb +1 -1
  39. data/public/application.js +0 -30
  40. data/test/benchmarks/benchmark.rake +97 -92
  41. data/test/benchmarks/dog.rb +1 -1
  42. data/test/benchmarks/init_rails.rake +4 -4
  43. data/test/coverband/adapters/base_test.rb +29 -30
  44. data/test/coverband/adapters/file_store_test.rb +15 -16
  45. data/test/coverband/adapters/hash_redis_store_test.rb +57 -57
  46. data/test/coverband/adapters/redis_store_test.rb +26 -26
  47. data/test/coverband/at_exit_test.rb +2 -2
  48. data/test/coverband/collectors/coverage_test.rb +33 -47
  49. data/test/coverband/collectors/delta_test.rb +51 -23
  50. data/test/coverband/collectors/view_tracker_test.rb +35 -35
  51. data/test/coverband/configuration_test.rb +27 -53
  52. data/test/coverband/coverband_test.rb +11 -11
  53. data/test/coverband/integrations/background_middleware_test.rb +10 -10
  54. data/test/coverband/integrations/background_test.rb +3 -2
  55. data/test/coverband/integrations/rack_server_check_test.rb +7 -7
  56. data/test/coverband/integrations/report_middleware_test.rb +9 -9
  57. data/test/coverband/integrations/resque_worker_test.rb +9 -9
  58. data/test/coverband/integrations/test_resque_job.rb +1 -1
  59. data/test/coverband/reporters/base_test.rb +9 -9
  60. data/test/coverband/reporters/console_test.rb +6 -6
  61. data/test/coverband/reporters/html_test.rb +36 -48
  62. data/test/coverband/reporters/web_test.rb +16 -18
  63. data/test/coverband/utils/absolute_file_converter_test.rb +22 -22
  64. data/test/coverband/utils/file_hasher_test.rb +6 -12
  65. data/test/coverband/utils/file_list_test.rb +13 -13
  66. data/test/coverband/utils/html_formatter_test.rb +9 -23
  67. data/test/coverband/utils/lines_classifier_test.rb +29 -29
  68. data/test/coverband/utils/relative_file_converter_test.rb +13 -13
  69. data/test/coverband/utils/result_test.rb +18 -18
  70. data/test/coverband/utils/results_test.rb +17 -17
  71. data/test/coverband/utils/source_file_line_test.rb +46 -46
  72. data/test/coverband/utils/source_file_test.rb +38 -88
  73. data/test/dog.rb +1 -1
  74. data/test/fake_app/basic_rack.rb +2 -2
  75. data/test/fixtures/app/controllers/sample_controller.rb +1 -1
  76. data/test/fixtures/app/models/user.rb +1 -1
  77. data/test/fixtures/sample.rb +1 -1
  78. data/test/fixtures/utf-8.rb +0 -2
  79. data/test/forked/rails_full_stack_test.rb +24 -27
  80. data/test/forked/rails_rake_full_stack_test.rb +7 -26
  81. data/test/integration/full_stack_test.rb +11 -22
  82. data/test/jruby_check.rb +2 -3
  83. data/test/rails4_dummy/Rakefile +1 -1
  84. data/test/rails4_dummy/config.ru +1 -1
  85. data/test/rails4_dummy/config/application.rb +4 -4
  86. data/test/rails4_dummy/config/boot.rb +2 -2
  87. data/test/rails4_dummy/config/coverband.rb +1 -1
  88. data/test/rails4_dummy/config/coverband_missing_redis.rb +1 -1
  89. data/test/rails4_dummy/config/environment.rb +1 -1
  90. data/test/rails4_dummy/config/routes.rb +2 -2
  91. data/test/rails5_dummy/Rakefile +1 -1
  92. data/test/rails5_dummy/config.ru +1 -1
  93. data/test/rails5_dummy/config/application.rb +3 -3
  94. data/test/rails5_dummy/config/coverband.rb +8 -8
  95. data/test/rails5_dummy/config/coverband_missing_redis.rb +8 -8
  96. data/test/rails5_dummy/config/environment.rb +1 -1
  97. data/test/rails5_dummy/config/routes.rb +2 -2
  98. data/test/rails6_dummy/Rakefile +1 -1
  99. data/test/rails6_dummy/config.ru +1 -1
  100. data/test/rails6_dummy/config/application.rb +4 -4
  101. data/test/rails6_dummy/config/boot.rb +2 -2
  102. data/test/rails6_dummy/config/coverband.rb +1 -1
  103. data/test/rails6_dummy/config/coverband_missing_redis.rb +1 -1
  104. data/test/rails6_dummy/config/environment.rb +1 -1
  105. data/test/rails6_dummy/config/routes.rb +2 -2
  106. data/test/rails_test_helper.rb +11 -11
  107. data/test/test_helper.rb +41 -34
  108. data/test/unique_files.rb +10 -10
  109. data/views/layout.erb +2 -12
  110. metadata +5 -43
  111. data/.rubocop.yml +0 -84
  112. data/lib/coverband/integrations/bundler.rb +0 -8
  113. data/lib/coverband/utils/file_groups.rb +0 -53
  114. data/lib/coverband/utils/gem_list.rb +0 -31
  115. data/lib/coverband/utils/s3_report.rb +0 -105
  116. data/test/coverband/utils/file_groups_test.rb +0 -61
  117. data/test/coverband/utils/gem_list_test.rb +0 -48
  118. data/test/coverband/utils/s3_report_test.rb +0 -44
  119. data/views/gem_list.erb +0 -63
@@ -1,60 +1,48 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../test_helper', File.dirname(__FILE__))
3
+ require File.expand_path("../test_helper", File.dirname(__FILE__))
4
4
 
5
5
  class BaseTest < Minitest::Test
6
6
  def setup
7
7
  super
8
8
  Coverband.configuration.reset
9
9
  Coverband.configure do |config|
10
- config.root = Dir.pwd
11
- config.s3_bucket = nil
12
- config.root_paths = ['/app_path/']
13
- config.ignore = ['config/envionments']
14
- config.reporter = 'std_out'
15
- config.store = Coverband::Adapters::RedisStore.new(Coverband::Test.redis, redis_namespace: 'coverband_test')
10
+ config.root = Dir.pwd
11
+ config.root_paths = ["/app_path/"]
12
+ config.ignore = ["config/envionments"]
13
+ config.reporter = "std_out"
14
+ config.store = Coverband::Adapters::RedisStore.new(Coverband::Test.redis, redis_namespace: "coverband_test")
16
15
  end
17
16
  end
18
17
 
19
- test 'ignore works with equal' do
20
- coverband = Coverband::Collectors::Coverage.instance.reset_instance
21
- expected = ['vendor/', '.erb$', '.slim$', '/tmp', 'internal:prelude', 'schema.rb', 'config/envionments']
18
+ test "ignore works with equal" do
19
+ Coverband::Collectors::Coverage.instance.reset_instance
20
+ expected = ["vendor/", ".erb$", ".slim$", "/tmp", "internal:prelude", "db/schema.rb", "config/envionments"]
22
21
  assert_equal expected, Coverband.configuration.ignore
23
22
  end
24
23
 
25
- test 'ignore works with plus equal' do
24
+ test "ignore works with plus equal" do
26
25
  Coverband.configure do |config|
27
- config.ignore += ['config/initializers']
26
+ config.ignore += ["config/initializers"]
28
27
  end
29
- coverband = Coverband::Collectors::Coverage.instance.reset_instance
30
- expected = ['vendor/',
31
- '.erb$',
32
- '.slim$',
33
- '/tmp',
34
- 'internal:prelude',
35
- 'schema.rb',
36
- 'config/envionments',
37
- 'config/initializers']
38
- assert_equal expected, Coverband.configuration.ignore
39
- end
40
-
41
- test 'ignore' do
42
- Coverband::Collectors::Coverage.instance.reset_instance
43
- assert !Coverband.configuration.gem_paths.first.nil?
44
- end
45
-
46
- test 'gem_paths' do
47
28
  Coverband::Collectors::Coverage.instance.reset_instance
48
- assert !Coverband.configuration.gem_paths.first.nil?
29
+ expected = ["vendor/",
30
+ ".erb$",
31
+ ".slim$",
32
+ "/tmp",
33
+ "internal:prelude",
34
+ "db/schema.rb",
35
+ "config/envionments",
36
+ "config/initializers"]
37
+ assert_equal expected, Coverband.configuration.ignore
49
38
  end
50
39
 
51
- test 'groups' do
40
+ test "ignore" do
52
41
  Coverband::Collectors::Coverage.instance.reset_instance
53
- Coverband.configuration.track_gems = true
54
- assert_equal %w[App Gems], Coverband.configuration.groups.keys
42
+ assert !Coverband.configuration.ignore.first.nil?
55
43
  end
56
44
 
57
- test 'all_root_paths' do
45
+ test "all_root_paths" do
58
46
  Coverband::Collectors::Coverage.instance.reset_instance
59
47
  current_paths = Coverband.configuration.root_paths.dup
60
48
  # verify previous bug fix
@@ -64,30 +52,16 @@ class BaseTest < Minitest::Test
64
52
  assert_equal current_paths, Coverband.configuration.root_paths
65
53
  end
66
54
 
67
- test 's3 options' do
68
- Coverband::Collectors::Coverage.instance.reset_instance
69
- Coverband.configure do |config|
70
- config.s3_bucket = 'bucket'
71
- config.s3_region = 'region'
72
- config.s3_access_key_id = 'key_id'
73
- config.s3_secret_access_key = 'secret'
74
- end
75
- assert_equal 'bucket', Coverband.configuration.s3_bucket
76
- assert_equal 'region', Coverband.configuration.s3_region
77
- assert_equal 'key_id', Coverband.configuration.s3_access_key_id
78
- assert_equal 'secret', Coverband.configuration.s3_secret_access_key
79
- end
80
-
81
- test 'store raises issues' do
55
+ test "store raises issues" do
82
56
  Coverband::Collectors::Coverage.instance.reset_instance
83
57
  assert_raises RuntimeError do
84
58
  Coverband.configure do |config|
85
- config.store = 'fake'
59
+ config.store = "fake"
86
60
  end
87
61
  end
88
62
  end
89
63
 
90
- test 'use_oneshot_lines_coverage' do
64
+ test "use_oneshot_lines_coverage" do
91
65
  refute Coverband.configuration.use_oneshot_lines_coverage
92
66
 
93
67
  Coverband.configuration.stubs(:one_shot_coverage_implemented_in_ruby_version?).returns(true)
@@ -101,7 +75,7 @@ class BaseTest < Minitest::Test
101
75
  exception = assert_raises Exception do
102
76
  Coverband.configuration.use_oneshot_lines_coverage = true
103
77
  end
104
- assert_equal 'One shot line coverage is only available in ruby >= 2.6', exception.message
78
+ assert_equal "One shot line coverage is only available in ruby >= 2.6", exception.message
105
79
  refute Coverband.configuration.use_oneshot_lines_coverage
106
80
  end
107
81
  end
@@ -1,42 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../test_helper', File.dirname(__FILE__))
3
+ require File.expand_path("../test_helper", File.dirname(__FILE__))
4
4
 
5
5
  class CoverbandTest < Minitest::Test
6
- test 'Coverband#start kicks off background reporting if enabled and not in rack server' do
7
- Coverband.configuration.stubs(:background_reporting_enabled).returns(:true)
6
+ test "Coverband#start kicks off background reporting if enabled and not in rack server" do
7
+ Coverband.configuration.stubs(:background_reporting_enabled).returns(true)
8
8
  Coverband::RackServerCheck.expects(:running?).returns(false)
9
9
  Coverband::Background.expects(:start)
10
10
  Coverband.start
11
11
  end
12
12
 
13
- test 'Coverband#start delays background reporting if enabled and running in a rack server' do
13
+ test "Coverband#start delays background reporting if enabled and running in a rack server" do
14
14
  Coverband.configuration.stubs(:background_reporting_enabled).returns(true)
15
15
  Coverband::RackServerCheck.expects(:running?).returns(true)
16
16
  Coverband::Background.expects(:start).never
17
17
  Coverband.start
18
18
  end
19
19
 
20
- test 'Coverband#start does not kick off background reporting if not enabled' do
20
+ test "Coverband#start does not kick off background reporting if not enabled" do
21
21
  Coverband.configuration.stubs(:background_reporting_enabled).returns(false)
22
22
  Coverband::Background.expects(:start).never
23
23
  ::Coverband.start
24
24
  end
25
25
 
26
- test 'Coverband#configured? works' do
26
+ test "Coverband#configured? works" do
27
27
  Coverband.configure
28
28
  assert Coverband.configured?
29
29
  end
30
30
 
31
- test 'Eager load coverage block' do
32
- Coverband.eager_loading_coverage {
33
- #some code
31
+ test "Eager load coverage block" do
32
+ Coverband.eager_loading_coverage do
33
+ # some code
34
34
  1 + 1
35
- }
35
+ end
36
36
  assert_equal :runtime, Coverband.configuration.store.type
37
37
  end
38
38
 
39
- test 'Eager load coverage' do
39
+ test "Eager load coverage" do
40
40
  Coverband.eager_loading_coverage!
41
41
  assert_equal :eager_loading, Coverband.configuration.store.type
42
42
  Coverband.runtime_coverage!
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../test_helper', File.dirname(__FILE__))
4
- require 'rack'
3
+ require File.expand_path("../../test_helper", File.dirname(__FILE__))
4
+ require "rack"
5
5
 
6
6
  class BackgroundMiddlewareTest < Minitest::Test
7
7
  def setup
@@ -11,23 +11,23 @@ class BackgroundMiddlewareTest < Minitest::Test
11
11
  end
12
12
  end
13
13
 
14
- test 'call app' do
15
- request = Rack::MockRequest.env_for('/anything.json')
14
+ test "call app" do
15
+ request = Rack::MockRequest.env_for("/anything.json")
16
16
  Coverband::Collectors::Coverage.instance.reset_instance
17
17
  middleware = Coverband::BackgroundMiddleware.new(fake_app)
18
18
  results = middleware.call(request)
19
- assert_equal '/anything.json', results.last
19
+ assert_equal "/anything.json", results.last
20
20
  end
21
21
 
22
- test 'pass all rack lint checks' do
22
+ test "pass all rack lint checks" do
23
23
  Coverband::Collectors::Coverage.instance.reset_instance
24
24
  app = Rack::Lint.new(Coverband::BackgroundMiddleware.new(fake_app))
25
- env = Rack::MockRequest.env_for('/hello')
25
+ env = Rack::MockRequest.env_for("/hello")
26
26
  app.call(env)
27
27
  end
28
28
 
29
- test 'starts background reporter when configured' do
30
- request = Rack::MockRequest.env_for('/anything.json')
29
+ test "starts background reporter when configured" do
30
+ request = Rack::MockRequest.env_for("/anything.json")
31
31
  Coverband.configuration.stubs(:background_reporting_enabled).returns(true)
32
32
  Coverband::Background.expects(:start)
33
33
  middleware = Coverband::BackgroundMiddleware.new(fake_app)
@@ -38,7 +38,7 @@ class BackgroundMiddlewareTest < Minitest::Test
38
38
 
39
39
  def fake_app
40
40
  @fake_app ||= lambda do |env|
41
- [200, { 'Content-Type' => 'text/plain' }, env['PATH_INFO']]
41
+ [200, {"Content-Type" => "text/plain"}, env["PATH_INFO"]]
42
42
  end
43
43
  end
44
44
  end
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../test_helper', File.dirname(__FILE__))
3
+ require File.expand_path("../../test_helper", File.dirname(__FILE__))
4
4
 
5
5
  class BackgroundTest < Minitest::Test
6
6
  class ThreadDouble < Struct.new(:alive)
7
- def exit; end
7
+ def exit
8
+ end
8
9
 
9
10
  def alive?
10
11
  alive
@@ -1,22 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../test_helper', File.dirname(__FILE__))
3
+ require File.expand_path("../../test_helper", File.dirname(__FILE__))
4
4
 
5
5
  class RackServerCheckTest < Minitest::Test
6
- test 'returns true when running in rack server' do
7
- caller_locations = ['blah/lib/rack/server.rb'].map { |path| OpenStruct.new(path: path, label: 'foo') }
6
+ test "returns true when running in rack server" do
7
+ caller_locations = ["blah/lib/rack/server.rb"].map { |path| OpenStruct.new(path: path, label: "foo") }
8
8
  Kernel.expects(:caller_locations).returns(caller_locations)
9
9
  assert(Coverband::RackServerCheck.running?)
10
10
  end
11
11
 
12
- test 'returns false when not running in rack server' do
13
- caller_locations = ['blah/lib/sidekiq/worker.rb'].map { |path| OpenStruct.new(path: path, label: 'foo') }
12
+ test "returns false when not running in rack server" do
13
+ caller_locations = ["blah/lib/sidekiq/worker.rb"].map { |path| OpenStruct.new(path: path, label: "foo") }
14
14
  Kernel.expects(:caller_locations).returns(caller_locations)
15
15
  refute(Coverband::RackServerCheck.running?)
16
16
  end
17
17
 
18
- test 'returns true if running within a rails server' do
19
- caller_locations = [OpenStruct.new(path: '/lib/rails/commands/commands_tasks.rb', label: 'server')]
18
+ test "returns true if running within a rails server" do
19
+ caller_locations = [OpenStruct.new(path: "/lib/rails/commands/commands_tasks.rb", label: "server")]
20
20
  Kernel.expects(:caller_locations).returns(caller_locations)
21
21
  assert(Coverband::RackServerCheck.running?)
22
22
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../test_helper', File.dirname(__FILE__))
4
- require 'coverband/integrations/report_middleware'
3
+ require File.expand_path("../../test_helper", File.dirname(__FILE__))
4
+ require "coverband/integrations/report_middleware"
5
5
 
6
6
  class ReportMiddlewareTest < Minitest::Test
7
7
  def setup
@@ -11,21 +11,21 @@ class ReportMiddlewareTest < Minitest::Test
11
11
  end
12
12
  end
13
13
 
14
- test 'reports coverage' do
15
- request = Rack::MockRequest.env_for('/anything.json')
14
+ test "reports coverage" do
15
+ request = Rack::MockRequest.env_for("/anything.json")
16
16
  Coverband::Collectors::Coverage.instance.expects(:report_coverage)
17
17
  middleware = Coverband::ReportMiddleware.new(fake_app)
18
18
  middleware.call(request)
19
19
  end
20
20
 
21
- test 'reports coverage when an error is raised' do
22
- request = Rack::MockRequest.env_for('/anything.json')
21
+ test "reports coverage when an error is raised" do
22
+ request = Rack::MockRequest.env_for("/anything.json")
23
23
  Coverband::Collectors::Coverage.instance.reset_instance
24
24
  Coverband::Collectors::Coverage.instance.expects(:report_coverage).once
25
25
  middleware = Coverband::ReportMiddleware.new(fake_app_raise_error)
26
26
  begin
27
27
  middleware.call(request)
28
- rescue StandardError
28
+ rescue
29
29
  nil
30
30
  end
31
31
  end
@@ -34,11 +34,11 @@ class ReportMiddlewareTest < Minitest::Test
34
34
 
35
35
  def fake_app
36
36
  @fake_app ||= lambda do |env|
37
- [200, { 'Content-Type' => 'text/plain' }, env['PATH_INFO']]
37
+ [200, {"Content-Type" => "text/plain"}, env["PATH_INFO"]]
38
38
  end
39
39
  end
40
40
 
41
41
  def fake_app_raise_error
42
- @fake_app_raise_error ||= -> { raise 'hell' }
42
+ @fake_app_raise_error ||= -> { raise "hell" }
43
43
  end
44
44
  end
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../test_helper', File.dirname(__FILE__))
3
+ require File.expand_path("../../test_helper", File.dirname(__FILE__))
4
4
 
5
5
  class ResqueWorkerTest < Minitest::Test
6
6
  def enqueue_and_run_job
7
7
  Resque.enqueue(TestResqueJob)
8
- queue = ENV['QUEUE'] = 'resque_coverband'
8
+ ENV["QUEUE"] = "resque_coverband"
9
9
  worker = Resque::Worker.new
10
10
  worker.startup
11
11
  worker.work_one_job
@@ -21,9 +21,9 @@ class ResqueWorkerTest < Minitest::Test
21
21
  Resque.redis = redis
22
22
  end
23
23
 
24
- test 'resque job coverage' do
25
- relative_job_file = './test/coverband/integrations/test_resque_job.rb'
26
- resque_job_file = File.expand_path('./test_resque_job.rb', File.dirname(__FILE__))
24
+ test "resque job coverage" do
25
+ relative_job_file = "./test/coverband/integrations/test_resque_job.rb"
26
+ resque_job_file = File.expand_path("./test_resque_job.rb", File.dirname(__FILE__))
27
27
  require resque_job_file
28
28
 
29
29
  enqueue_and_run_job
@@ -35,13 +35,13 @@ class ResqueWorkerTest < Minitest::Test
35
35
  Coverband.runtime_coverage!
36
36
  report = Coverband.configuration.store.get_coverage_report
37
37
 
38
- if RUBY_PLATFORM == 'java'
38
+ if RUBY_PLATFORM == "java"
39
39
  # NOTE: the todo test only issue seems to be slightly different in JRuby
40
40
  # were nothing is showing up as runtime Coverage... This appears to be a test only issue
41
- assert_equal 1, report[Coverband::EAGER_TYPE][relative_job_file]['data'][6]
41
+ assert_equal 1, report[Coverband::EAGER_TYPE][relative_job_file]["data"][6]
42
42
  else
43
- assert_equal 0, report[Coverband::EAGER_TYPE][relative_job_file]['data'][6]
44
- assert_equal 1, report[Coverband::RUNTIME_TYPE][relative_job_file]['data'][6]
43
+ assert_equal 0, report[Coverband::EAGER_TYPE][relative_job_file]["data"][6]
44
+ assert_equal 1, report[Coverband::RUNTIME_TYPE][relative_job_file]["data"][6]
45
45
  end
46
46
  end
47
47
  end
@@ -4,6 +4,6 @@ class TestResqueJob
4
4
  @queue = :resque_coverband
5
5
 
6
6
  def self.perform
7
- 'resque job perform'
7
+ "resque job perform"
8
8
  end
9
9
  end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../test_helper', File.dirname(__FILE__))
3
+ require File.expand_path("../../test_helper", File.dirname(__FILE__))
4
4
 
5
5
  class ReportsBaseTest < Minitest::Test
6
6
  def setup
7
7
  super
8
8
  end
9
9
 
10
- test '#merge_arrays basic merge preserves order and counts' do
10
+ test "#merge_arrays basic merge preserves order and counts" do
11
11
  first = [0, 0, 1, 0, 1]
12
12
  second = [nil, 0, 1, 0, 0]
13
13
  expects = [0, 0, 2, 0, 1]
@@ -15,7 +15,7 @@ class ReportsBaseTest < Minitest::Test
15
15
  assert_equal expects, Coverband::Reporters::Base.send(:merge_arrays, first, second)
16
16
  end
17
17
 
18
- test '#merge_arrays basic merge preserves order and counts different lengths' do
18
+ test "#merge_arrays basic merge preserves order and counts different lengths" do
19
19
  first = [0, 0, 1, 0, 1]
20
20
  second = [nil, 0, 1, 0, 0, 0, 0, 1]
21
21
  expects = [0, 0, 2, 0, 1, 0, 0, 1]
@@ -23,7 +23,7 @@ class ReportsBaseTest < Minitest::Test
23
23
  assert_equal expects, Coverband::Reporters::Base.send(:merge_arrays, first, second)
24
24
  end
25
25
 
26
- test '#merge_arrays basic merge preserves nils' do
26
+ test "#merge_arrays basic merge preserves nils" do
27
27
  first = [0, 1, 2, nil, nil, nil]
28
28
  second = [0, 1, 2, nil, 0, 1, 2]
29
29
  expects = [0, 2, 4, nil, 0, 1, 2]
@@ -33,16 +33,16 @@ class ReportsBaseTest < Minitest::Test
33
33
 
34
34
  test "#get_current_scov_data_imp doesn't ignore folders with default ignore keys" do
35
35
  Coverband.configure do |config|
36
- config.reporter = 'std_out'
37
- config.root = '/full/remote_app/path'
36
+ config.reporter = "std_out"
37
+ config.root = "/full/remote_app/path"
38
38
  end
39
39
 
40
- key = '/a_path/that_has_erb_in/thepath.rb'
41
- roots = ['/app/', '/full/remote_app/path/']
40
+ key = "/a_path/that_has_erb_in/thepath.rb"
41
+ roots = ["/app/", "/full/remote_app/path/"]
42
42
 
43
43
  lines_hit = [1, 3, 6]
44
44
  store.stubs(:merged_coverage).returns(key => lines_hit)
45
- expected = { key => [1, 3, 6] }
45
+ expected = {key => [1, 3, 6]}
46
46
 
47
47
  assert_equal expected, Coverband::Reporters::Base.send(:get_current_scov_data_imp, store, roots)[:merged]
48
48
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../test_helper', File.dirname(__FILE__))
3
+ require File.expand_path("../../test_helper", File.dirname(__FILE__))
4
4
 
5
5
  class HTMLReportTest < Minitest::Test
6
6
  REDIS_STORAGE_FORMAT_VERSION = Coverband::Adapters::RedisStore::REDIS_STORAGE_FORMAT_VERSION
@@ -10,17 +10,17 @@ class HTMLReportTest < Minitest::Test
10
10
  @store = Coverband.configuration.store
11
11
  end
12
12
 
13
- test 'report data' do
13
+ test "report data" do
14
14
  Coverband.configure do |config|
15
- config.reporter = 'std_out'
15
+ config.reporter = "std_out"
16
16
  end
17
- Coverband.configuration.logger.stubs('info')
17
+ Coverband.configuration.logger.stubs("info")
18
18
  mock_file_hash
19
- Coverband::Utils::RelativeFileConverter.expects(:convert).with('app_path/dog.rb').returns('./dog.rb')
19
+ Coverband::Utils::RelativeFileConverter.expects(:convert).with("app_path/dog.rb").returns("./dog.rb")
20
20
  @store.send(:save_report, basic_coverage)
21
21
 
22
22
  report = Coverband::Reporters::ConsoleReport.report(@store)[:merged]
23
- expected = { './dog.rb' => [0, 1, 2] }
23
+ expected = {"./dog.rb" => [0, 1, 2]}
24
24
  assert_equal(expected.keys, report.keys)
25
25
  end
26
26
  end