mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Merge pull request #1183 from rails-api/block_style
Update Rubocop todo
This commit is contained in:
@@ -400,25 +400,25 @@ module ActionController
|
||||
end
|
||||
|
||||
def test_warn_overridding_use_adapter_as_falsy_on_controller_instance
|
||||
controller = Class.new(ImplicitSerializationTestController) {
|
||||
controller = Class.new(ImplicitSerializationTestController) do
|
||||
def use_adapter?
|
||||
false
|
||||
end
|
||||
}.new
|
||||
assert_match(/adapter: false/, (capture(:stderr) {
|
||||
end.new
|
||||
assert_match(/adapter: false/, (capture(:stderr) do
|
||||
controller.get_serializer(Profile.new)
|
||||
}))
|
||||
end))
|
||||
end
|
||||
|
||||
def test_dont_warn_overridding_use_adapter_as_truthy_on_controller_instance
|
||||
controller = Class.new(ImplicitSerializationTestController) {
|
||||
controller = Class.new(ImplicitSerializationTestController) do
|
||||
def use_adapter?
|
||||
true
|
||||
end
|
||||
}.new
|
||||
assert_equal '', (capture(:stderr) {
|
||||
end.new
|
||||
assert_equal '', (capture(:stderr) do
|
||||
controller.get_serializer(Profile.new)
|
||||
})
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,9 +28,9 @@ class CaptureWarnings
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def after_tests(lines)
|
||||
app_warnings, other_warnings = lines.partition { |line|
|
||||
app_warnings, other_warnings = lines.partition do |line|
|
||||
line.include?(app_root) && !line.include?(bundle_dir)
|
||||
}
|
||||
end
|
||||
|
||||
header = "#{'-' * 22} app warnings: #{'-' * 22}"
|
||||
output.puts
|
||||
|
||||
Reference in New Issue
Block a user