Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/code_climate/test_reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def self.start
require "simplecov"
::SimpleCov.add_filter 'vendor'
::SimpleCov.formatter = Formatter
::SimpleCov.start("test_frameworks")
::SimpleCov.start(configuration.profile)
end
end

Expand Down
6 changes: 5 additions & 1 deletion lib/code_climate/test_reporter/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ def self.configuration
end

class Configuration
attr_accessor :branch, :logger
attr_accessor :branch, :logger, :profile

def logger
@logger ||= default_logger
end

def profile
@profile ||= "test_frameworks"
end

private

def default_logger
Expand Down
9 changes: 9 additions & 0 deletions spec/lib/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module CodeClimate::TestReporter
expect(CodeClimate::TestReporter.configuration.branch).to be_nil
expect(CodeClimate::TestReporter.configuration.logger).to be_instance_of Logger
expect(CodeClimate::TestReporter.configuration.logger.level).to eq Logger::INFO
expect(CodeClimate::TestReporter.configuration.profile).to eq('test_frameworks')
end
end

Expand All @@ -38,6 +39,14 @@ module CodeClimate::TestReporter

expect(CodeClimate::TestReporter.configuration.branch).to eq :master
end

it 'stores profile' do
CodeClimate::TestReporter.configure do |config|
config.profile = 'custom'
end

expect(CodeClimate::TestReporter.configuration.profile).to eq('custom')
end
end
end
end