Skip to content

Commit

Permalink
Merge b257ab9 into b9ba4ec
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Mar 18, 2023
2 parents b9ba4ec + b257ab9 commit 7547860
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
1 change: 0 additions & 1 deletion beaker.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'fakefs', '~> 2.4'
s.add_development_dependency 'rake', '~> 13.0'
s.add_development_dependency 'rspec', '~> 3.0'
s.add_development_dependency 'rspec-its'

# Documentation dependencies
s.add_development_dependency 'yard', '~> 0.9.11'
Expand Down
50 changes: 35 additions & 15 deletions spec/beaker/logger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,13 @@ def prefix_log_line_test_compare_helper(in_test, out_answer)
end

context 'default for' do
its(:destinations) { is_expected.to include(STDOUT) }
its(:color) { is_expected.to be_nil }
its(:log_level) { is_expected.to be :verbose }
it do
expect(subject).to have_attributes(
destinations: include(STDOUT),
color: be_nil,
log_level: :verbose,
)
end
end

context 'log_colors' do
Expand Down Expand Up @@ -291,9 +295,13 @@ def prefix_log_line_test_compare_helper(in_test, out_answer)
:color => true)
}

its(:is_debug?) { is_expected.to be_truthy }
its(:is_trace?) { is_expected.to be_truthy }
its(:is_warn?) { is_expected.to be_truthy }
it do
expect(subject).to have_attributes(
:is_debug? => be_truthy,
:is_trace? => be_truthy,
:is_warn? => be_truthy,
)
end

context 'but print' do
before do
Expand All @@ -317,10 +325,14 @@ def prefix_log_line_test_compare_helper(in_test, out_answer)
:color => true)
}

its(:is_trace?) { is_expected.to be_falsy }
its(:is_debug?) { is_expected.to be_falsy }
its(:is_verbose?) { is_expected.to be_truthy }
its(:is_warn?) { is_expected.to be_truthy }
it do
expect(subject).to have_attributes(
:is_trace? => be_falsy,
:is_debug? => be_falsy,
:is_verbose? => be_truthy,
:is_warn? => be_truthy,
)
end

context 'but print' do
before do
Expand All @@ -343,9 +355,13 @@ def prefix_log_line_test_compare_helper(in_test, out_answer)
:color => true)
}

its(:is_trace?) { is_expected.to be_falsy }
its(:is_debug?) { is_expected.to be_truthy }
its(:is_warn?) { is_expected.to be_truthy }
it do
expect(subject).to have_attributes(
:is_trace? => be_falsy,
:is_debug? => be_truthy,
:is_warn? => be_truthy,
)
end

context 'successfully print' do
before do
Expand All @@ -368,8 +384,12 @@ def prefix_log_line_test_compare_helper(in_test, out_answer)
:color => true)
}

its(:is_debug?) { is_expected.to be_falsy }
its(:is_trace?) { is_expected.to be_falsy }
it do
expect(subject).to have_attributes(
:is_debug? => be_falsy,
:is_trace? => be_falsy,
)
end

context 'skip' do
before do
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
require 'mocks'
require 'helpers'
require 'matchers'
require 'rspec/its'

RSpec.configure do |config|
config.include FakeFS::SpecHelpers
Expand Down

0 comments on commit 7547860

Please sign in to comment.