Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop rspec-its dependency in favor of have_attributes #1788

Merged
merged 1 commit into from
Mar 20, 2023
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
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