@@ -963,23 +963,30 @@ def bin_path(a,b,c)
963963 puts "__FILE__: #{__FILE__.inspect}"
964964 RUBY
965965
966- let ( :expected ) { super ( ) + <<~EOS . chomp }
966+ context "when the path is absolute" do
967+ let ( :expected ) { super ( ) + <<~EOS . chomp }
967968
968- $0: #{ path . to_s . inspect }
969- __FILE__: #{ path . to_s . inspect }
970- EOS
969+ $0: #{ path . to_s . inspect }
970+ __FILE__: #{ path . to_s . inspect }
971+ EOS
971972
972- it "runs" do
973- skip "https://github.com/rubygems/rubygems/issues/3351" if Gem . win_platform?
973+ it "runs" do
974+ skip "https://github.com/rubygems/rubygems/issues/3351" if Gem . win_platform?
974975
975- subject
976- expect ( exitstatus ) . to eq ( exit_code )
977- expect ( err ) . to eq ( expected_err )
978- expect ( out ) . to eq ( expected )
976+ subject
977+ expect ( exitstatus ) . to eq ( exit_code )
978+ expect ( err ) . to eq ( expected_err )
979+ expect ( out ) . to eq ( expected )
980+ end
979981 end
980982
981983 context "when the path is relative" do
982984 let ( :path ) { super ( ) . relative_path_from ( bundled_app ) }
985+ let ( :expected ) { super ( ) + <<~EOS . chomp }
986+
987+ $0: #{ path . to_s . inspect }
988+ __FILE__: #{ path . to_s . inspect }
989+ EOS
983990
984991 it "runs" do
985992 skip "https://github.com/rubygems/rubygems/issues/3351" if Gem . win_platform?
@@ -993,8 +1000,20 @@ def bin_path(a,b,c)
9931000
9941001 context "when the path is relative with a leading ./" do
9951002 let ( :path ) { Pathname . new ( "./#{ super ( ) . relative_path_from ( bundled_app ) } " ) }
1003+ let ( :expected ) { super ( ) + <<~EOS . chomp }
1004+
1005+ $0: #{ path . to_s . inspect }
1006+ __FILE__: #{ File . expand_path ( path , bundled_app ) . inspect }
1007+ EOS
1008+
1009+ it "runs" do
1010+ skip "https://github.com/rubygems/rubygems/issues/3351" if Gem . win_platform?
9961011
997- pending "relative paths with ./ have absolute __FILE__"
1012+ subject
1013+ expect ( exitstatus ) . to eq ( exit_code )
1014+ expect ( err ) . to eq ( expected_err )
1015+ expect ( out ) . to eq ( expected )
1016+ end
9981017 end
9991018 end
10001019
0 commit comments