File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ def apply(path, config = {})
219
219
220
220
contents = if is_uri
221
221
require "open-uri"
222
- open ( path , "Accept" => "application/x-thor-template" , &:read )
222
+ URI . open ( path , "Accept" => "application/x-thor-template" , &:read )
223
223
else
224
224
open ( path , &:read )
225
225
end
Original file line number Diff line number Diff line change @@ -231,13 +231,17 @@ def file
231
231
232
232
it "accepts a URL as the path" do
233
233
@file = "http://gist.github.com/103208.txt"
234
- expect ( runner ) . to receive ( :open ) . with ( @file , "Accept" => "application/x-thor-template" ) . and_return ( @template )
234
+ stub_request ( :get , @file )
235
+
236
+ expect ( runner ) . to receive ( :apply ) . with ( @file ) . and_return ( @template )
235
237
action ( :apply , @file )
236
238
end
237
239
238
240
it "accepts a secure URL as the path" do
239
241
@file = "https://gist.github.com/103208.txt"
240
- expect ( runner ) . to receive ( :open ) . with ( @file , "Accept" => "application/x-thor-template" ) . and_return ( @template )
242
+ stub_request ( :get , @file )
243
+
244
+ expect ( runner ) . to receive ( :apply ) . with ( @file ) . and_return ( @template )
241
245
action ( :apply , @file )
242
246
end
243
247
You can’t perform that action at this time.
0 commit comments