Skip to content

Commit

Permalink
Merge pull request #2128 from Shopify/repo-name-in-tests
Browse files Browse the repository at this point in the history
Un-hardcode repo name in test suite
  • Loading branch information
soutaro authored Dec 9, 2024
2 parents 1a3ab85 + c53d9a9 commit 305389b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions test/rbs/cli_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ def test_method
assert_includes stdout.string, 'accessibility: public'
assert_includes stdout.string, 'types:'
assert_includes stdout.string, ' () -> ::Enumerator[self, untyped]'
assert_includes stdout.string, 'rbs/core/kernel.rbs'
assert_includes stdout.string, 'core/kernel.rbs'
assert_includes stdout.string, '| [T] () { (self) -> T } -> T'
assert_includes stdout.string, 'rbs/core/kernel.rbs'
assert_includes stdout.string, 'core/kernel.rbs'
end

Dir.mktmpdir do |dir|
Expand Down Expand Up @@ -855,8 +855,8 @@ def test_version
def test_paths
with_cli do |cli|
cli.run(%w(-r pathname -I no-such-dir paths))
assert_match %r{/rbs/core \(dir, core\)$}, stdout.string
assert_match %r{/rbs/stdlib/pathname/0 \(dir, library, name=pathname\)$}, stdout.string
assert_match %r{/core \(dir, core\)$}, stdout.string
assert_match %r{/stdlib/pathname/0 \(dir, library, name=pathname\)$}, stdout.string
assert_match %r{^no-such-dir \(absent\)$}, stdout.string
end
end
Expand All @@ -866,7 +866,7 @@ def test_paths_with_gem

with_cli do |cli|
cli.run(%w(-r rbs-amber paths))
assert_match %r{/rbs/core \(dir, core\)$}, stdout.string
assert_match %r{/core \(dir, core\)$}, stdout.string
assert_match %r{/sig \(dir, library, name=rbs-amber\)$}, stdout.string
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/rbs/collection/installer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_install_from_gem_sig_dir

assert dest.directory?
assert dest.glob('*').empty? # because rubygems installer does nothing
assert_match(%r!Using rbs-amber:1.0.0 \(.+/rbs/test/assets/test-gem/sig\)!, stdout.string)
assert_match(%r!Using rbs-amber:1.0.0 \(.+/test/assets/test-gem/sig\)!, stdout.string)
assert_match("It's done! 1 gems' RBSs now installed.", stdout.string)
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/rbs/test/runtime_test_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def refute_test_success(other_env: {}, rbs_content: nil, ruby_content: nil)

def test_test_target
output = refute_test_success(other_env: { "RBS_TEST_TARGET" => nil })
assert_match "rbs/test/setup handles the following environment variables:", output
assert_match "test/setup handles the following environment variables:", output
end

def test_no_test_install
Expand Down

0 comments on commit 305389b

Please sign in to comment.