@@ -963,23 +963,30 @@ def bin_path(a,b,c)
963
963
puts "__FILE__: #{__FILE__.inspect}"
964
964
RUBY
965
965
966
- let ( :expected ) { super ( ) + <<~EOS . chomp }
966
+ context "when the path is absolute" do
967
+ let ( :expected ) { super ( ) + <<~EOS . chomp }
967
968
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
971
972
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?
974
975
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
979
981
end
980
982
981
983
context "when the path is relative" do
982
984
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
983
990
984
991
it "runs" do
985
992
skip "https://github.com/rubygems/rubygems/issues/3351" if Gem . win_platform?
@@ -993,8 +1000,20 @@ def bin_path(a,b,c)
993
1000
994
1001
context "when the path is relative with a leading ./" do
995
1002
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?
996
1011
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
998
1017
end
999
1018
end
1000
1019
0 commit comments