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

Use warnings_logger instead of warnings_spy; fix stray warnings #1328

Merged
merged 2 commits into from
Aug 24, 2020
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: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ gem 'rake', '13.0.1'
gem 'rspec', '~> 3.9'
gem 'rubocop', require: false
gem 'rubocop-rails', require: false
gem 'warnings_logger'
gem 'zeus', require: false

# YARD
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ GEM
ruby-progressbar (1.10.1)
thor (0.20.0)
unicode-display_width (1.6.0)
warnings_logger (0.1.1)
yard (0.9.20)
zeus (0.15.14)
method_source (>= 0.6.7)
Expand All @@ -73,6 +74,7 @@ DEPENDENCIES
rspec (~> 3.9)
rubocop
rubocop-rails
warnings_logger
yard
zeus

Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_4_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gem "rake", "13.0.1"
gem "rspec", "~> 3.9"
gem "rubocop", require: false
gem "rubocop-rails", require: false
gem "warnings_logger"
gem "zeus", require: false
gem "fssm"
gem "pygments.rb"
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_4_2.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ GEM
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.6.0)
warnings_logger (0.1.1)
yard (0.9.20)
zeus (0.15.14)
method_source (>= 0.6.7)
Expand Down Expand Up @@ -243,6 +244,7 @@ DEPENDENCIES
sqlite3 (~> 1.3.6)
turbolinks
uglifier (>= 1.3.0)
warnings_logger
yard
zeus

Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_5_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gem "rake", "13.0.1"
gem "rspec", "~> 3.9"
gem "rubocop", require: false
gem "rubocop-rails", require: false
gem "warnings_logger"
gem "zeus", require: false
gem "fssm"
gem "pygments.rb"
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_5_0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ GEM
tzinfo (1.2.6)
thread_safe (~> 0.1)
unicode-display_width (1.6.0)
warnings_logger (0.1.1)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
Expand Down Expand Up @@ -235,6 +236,7 @@ DEPENDENCIES
spring-watcher-listen (~> 2.0.0)
sqlite3 (~> 1.3.6)
turbolinks (~> 5)
warnings_logger
yard
zeus

Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_5_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gem "rake", "13.0.1"
gem "rspec", "~> 3.9"
gem "rubocop", require: false
gem "rubocop-rails", require: false
gem "warnings_logger"
gem "zeus", require: false
gem "fssm"
gem "pygments.rb"
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_5_1.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ GEM
tzinfo (1.2.6)
thread_safe (~> 0.1)
unicode-display_width (1.6.0)
warnings_logger (0.1.1)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
Expand Down Expand Up @@ -251,6 +252,7 @@ DEPENDENCIES
spring-watcher-listen (~> 2.0.0)
sqlite3 (~> 1.3.6)
turbolinks (~> 5)
warnings_logger
yard
zeus

Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_5_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gem "rake", "13.0.1"
gem "rspec", "~> 3.9"
gem "rubocop", require: false
gem "rubocop-rails", require: false
gem "warnings_logger"
gem "zeus", require: false
gem "fssm"
gem "pygments.rb"
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_5_2.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ GEM
tzinfo (1.2.6)
thread_safe (~> 0.1)
unicode-display_width (1.6.0)
warnings_logger (0.1.1)
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
Expand Down Expand Up @@ -270,6 +271,7 @@ DEPENDENCIES
spring-watcher-listen (~> 2.0.0)
sqlite3 (~> 1.3.6)
turbolinks (~> 5)
warnings_logger
yard
zeus

Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_6_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gem "rake", "13.0.1"
gem "rspec", "~> 3.9"
gem "rubocop", require: false
gem "rubocop-rails", require: false
gem "warnings_logger"
gem "zeus", require: false
gem "fssm"
gem "pygments.rb"
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_6_0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ GEM
tzinfo (1.2.6)
thread_safe (~> 0.1)
unicode-display_width (1.6.0)
warnings_logger (0.1.1)
webdrivers (4.1.3)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
Expand Down Expand Up @@ -286,6 +287,7 @@ DEPENDENCIES
spring-watcher-listen (~> 2.0.0)
sqlite3 (~> 1.4)
turbolinks (~> 5)
warnings_logger
webdrivers
yard
zeus
Expand Down
1 change: 0 additions & 1 deletion lib/shoulda/matchers/independent.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'shoulda/matchers/independent/delegate_method_matcher'
require 'shoulda/matchers/independent/delegate_method_matcher/stubbed_target'
require 'shoulda/matchers/independent/delegate_method_matcher/target_not_defined_error'

module Shoulda
Expand Down

This file was deleted.

11 changes: 6 additions & 5 deletions spec/report_warnings.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require File.expand_path('../warnings_spy', __FILE__)
require 'warnings_logger'

# Adapted from <http://myronmars.to/n/dev-blog/2011/08/making-your-gem-warning-free>
WarningsLogger.configure do |config|
config.project_name = 'shoulda-matchers'
config.project_directory = Pathname.new('..').expand_path(__dir__)
end

warnings_spy = WarningsSpy.new('shoulda-matchers')
warnings_spy.capture_warnings
warnings_spy.report_warnings_at_exit
WarningsLogger.enable
1 change: 1 addition & 0 deletions spec/unit/shoulda/matchers/doublespeak/double_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ module Shoulda::Matchers::Doublespeak
doubles[0].activate

was_called = false
klass.__send__(:remove_method, method_name)
klass.__send__(:define_method, method_name) do
was_called = true
end
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def country
person = Person.new

expect {
expect(person).to delegate_method(:hello). to(:country).with_prefix
expect(person).to delegate_method(:hello).to(:country).with_prefix
}.to fail_with_message(message)
end
end
Expand Down Expand Up @@ -592,7 +592,9 @@ def country; end
MESSAGE

expectation = lambda do
expect(person).to delegate_method(:hello).to(:country).allow_nil
silence_warnings do
expect(person).to delegate_method(:hello).to(:country).allow_nil
end
end

expect(&expectation).to fail_with_message(message)
Expand Down
64 changes: 0 additions & 64 deletions spec/warnings_spy.rb

This file was deleted.

45 changes: 0 additions & 45 deletions spec/warnings_spy/filesystem.rb

This file was deleted.

Loading