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 friendlier names for $: and $" in test/activate_test.rb #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
30 changes: 15 additions & 15 deletions test/activate_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def test_basic_gem_activation
require "rack"
require "rack/request"

puts $:.grep(/\brack/).join(":")
puts $".grep(/\brack\/request/).join(":")
puts $LOAD_PATH.grep(/\brack/).join(":")
puts $LOADED_FEATURES.grep(/\brack\/request/).join(":")
END

assert_equal "#{store.root}/gems/rack-2.0.3/lib", output.shift
Expand All @@ -36,8 +36,8 @@ def test_basic_gem_activation_prefers_latest
require "rack"
require "rack/request"

puts $:.grep(/\brack/).join(":")
puts $".grep(/\brack\/request/).join(":")
puts $LOAD_PATH.grep(/\brack/).join(":")
puts $LOADED_FEATURES.grep(/\brack\/request/).join(":")
END

assert_equal "#{store.root}/gems/rack-2.0.3/lib", output.shift
Expand All @@ -55,11 +55,11 @@ def test_basic_gem_activation_loads_older_when_requested
Gel::Environment.gem "rack", "< 2"

# Avoid requiring "rack" itself, because 0.1.0's rack.rb
# directly manipulates $:, which is confusing
# directly manipulates $LOAD_PATH, which is confusing
require "rack/utils"

puts $:.grep(/\brack/).join(":")
puts $".grep(/\brack\/utils/).join(":")
puts $LOAD_PATH.grep(/\brack/).join(":")
puts $LOADED_FEATURES.grep(/\brack\/utils/).join(":")
END

assert_equal "#{store.root}/gems/rack-0.1.0/lib", output.shift
Expand All @@ -76,8 +76,8 @@ def test_automatic_gem_activation
Gel::Environment.open(store)
require Gel::Environment.resolve_gem_path("rack/request")

puts $:.grep(/\brack/).join(":")
puts $".grep(/\brack\/request/).join(":")
puts $LOAD_PATH.grep(/\brack/).join(":")
puts $LOADED_FEATURES.grep(/\brack\/request/).join(":")
END

assert_equal "#{store.root}/gems/rack-2.0.3/lib", output.shift
Expand All @@ -94,8 +94,8 @@ def test_automatic_gem_activation_prefers_latest
Gel::Environment.open(store)
require Gel::Environment.resolve_gem_path("rack/request")

puts $:.grep(/\brack/).join(":")
puts $".grep(/\brack\/request/).join(":")
puts $LOAD_PATH.grep(/\brack/).join(":")
puts $LOADED_FEATURES.grep(/\brack\/request/).join(":")
END

assert_equal "#{store.root}/gems/rack-2.0.3/lib", output.shift
Expand All @@ -111,9 +111,9 @@ def test_activate_simple_dependencies
Gel::Environment.open(store)
require Gel::Environment.resolve_gem_path("rack/test")

puts $:.grep(/\brack(?!-test)/).join(":")
puts $:.grep(/rack-test/).join(":")
puts $".grep(/rack\/test\/ut/).join(":")
puts $LOAD_PATH.grep(/\brack(?!-test)/).join(":")
puts $LOAD_PATH.grep(/rack-test/).join(":")
puts $LOADED_FEATURES.grep(/rack\/test\/ut/).join(":")
END

assert_equal "#{store.root}/gems/rack-2.0.3/lib", output.shift
Expand Down Expand Up @@ -168,7 +168,7 @@ def test_activate_gem_with_extensions
Gel::Environment.open(store)
require Gel::Environment.resolve_gem_path("fast_blank")

puts $:.grep(/fast_blank/).join(":")
puts $LOAD_PATH.grep(/fast_blank/).join(":")

puts ["x", "", " "].map(&:blank?).join(",")
END
Expand Down