Skip to content

Commit

Permalink
Fix rubocop offences
Browse files Browse the repository at this point in the history
  • Loading branch information
kamipo committed Aug 11, 2021
1 parent 7271d5e commit ee98178
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions activesupport/test/dependencies_test.rb
Expand Up @@ -140,8 +140,8 @@ class RequireDependencyTest < ActiveSupport::TestCase
end

test "require_dependency looks autoload paths up (idempotent)" do
assert require_dependency("x")
assert !require_dependency("x")
assert require_dependency("x")
assert_not require_dependency("x")
end

test "require_dependency handles absolute paths correctly" do
Expand All @@ -150,8 +150,8 @@ class RequireDependencyTest < ActiveSupport::TestCase
end

test "require_dependency handles absolute paths correctly (idempotent)" do
assert require_dependency("#{@root_dir}/x.rb")
assert !require_dependency("#{@root_dir}/x.rb")
assert require_dependency("#{@root_dir}/x.rb")
assert_not require_dependency("#{@root_dir}/x.rb")
end

test "require_dependency supports arguments that respond to to_path" do
Expand All @@ -166,8 +166,8 @@ def x.to_path; "x"; end
x = Object.new
def x.to_path; "x"; end

assert require_dependency(x)
assert !require_dependency(x)
assert require_dependency(x)
assert_not require_dependency(x)
end

test "require_dependency fallback to Kernel#require" do
Expand All @@ -187,8 +187,8 @@ def x.to_path; "x"; end
$LOAD_PATH << dir
File.write("#{dir}/y.rb", "Y = :Y")

assert require_dependency("y")
assert !require_dependency("y")
assert require_dependency("y")
assert_not require_dependency("y")
ensure
$LOAD_PATH.pop
Object.send(:remove_const, :Y) if Object.const_defined?(:Y)
Expand Down

1 comment on commit ee98178

@fxn
Copy link
Member

@fxn fxn commented on ee98178 Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kamipo!

Please sign in to comment.