File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ def open_in_browser?
88
88
# The directory path where the 'index.html' we want to open is
89
89
# stored
90
90
def show_in_browser ( dir )
91
- uri = URI . join ( "file://#{ dir } /" , 'index.html' )
91
+ uri = URI . join ( URI . escape ( "file://#{ dir } /" ) , 'index.html' )
92
92
Launchy . open ( uri ) if open_in_browser?
93
93
end
94
94
end
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ def directory(name)
87
87
it "can open the results in the browser" do
88
88
formatter = MetricFu ::Formatter ::HTML . new
89
89
path = MetricFu . run_path . join ( directory ( 'output_directory' ) )
90
- uri = URI . join ( "file://#{ path } /" , 'index.html' )
90
+ uri = URI . join ( URI . escape ( "file://#{ path } /" ) , 'index.html' )
91
91
expect ( Launchy ) . to receive ( :open ) . with ( uri )
92
92
formatter . finish
93
93
formatter . display_results
@@ -140,7 +140,7 @@ def directory(name)
140
140
it "can open the results in the browser from the custom output directory" do
141
141
formatter = MetricFu ::Formatter ::HTML . new ( output : @output )
142
142
path = MetricFu . run_path . join ( "#{ directory ( 'base_directory' ) } /#{ @output } " )
143
- uri = URI . join ( "file://#{ path } /" , 'index.html' )
143
+ uri = URI . join ( URI . escape ( "file://#{ path } /" ) , 'index.html' )
144
144
expect ( Launchy ) . to receive ( :open ) . with ( uri )
145
145
formatter . finish
146
146
formatter . display_results
Original file line number Diff line number Diff line change 70
70
expect ( test_result . success ) . to eq ( false )
71
71
end
72
72
specify 'succeeds when the code exits with a zero exit status' do
73
- code = "sh #{ fixtures_path . join ( 'exit0.sh' ) . to_path } "
73
+ code = "sh ' #{ fixtures_path . join ( 'exit0.sh' ) . to_path } ' "
74
74
test_result = SnippetRunner . new ( code , 'sh' ) . run_code
75
75
expect ( test_result . captured_output ) . to match ( "exit status 0" )
76
76
expect ( test_result . success ) . to eq ( true )
77
77
end
78
78
specify 'fails when the code exits with a non-zero exit status' do
79
- code = "sh #{ fixtures_path . join ( 'exit1.sh' ) . to_path } "
79
+ code = "sh ' #{ fixtures_path . join ( 'exit1.sh' ) . to_path } ' "
80
80
test_result = SnippetRunner . new ( code , 'sh' ) . run_code
81
81
expect ( test_result . captured_output ) . to match ( "exit status 1" )
82
82
expect ( test_result . success ) . to eq ( false )
You can’t perform that action at this time.
0 commit comments