Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ffmpeg/movie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def valid?
end

def remote?
@path =~ URI::regexp(%w(http https))
@path&.start_with?(%r{http(s?)://})
end

def local?
Expand Down
6 changes: 6 additions & 0 deletions spec/ffmpeg/movie_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ module FFMPEG
end
end

context "given a file containing http in the name" do
it 'should see local files with http in their name as local' do
expect(Movie.new("#{fixture_path}/movies/file_with_http_in_name.flv").remote?).to be false
end
end

context "given a URL" do
before(:context) { start_web_server }
after(:context) { stop_web_server }
Expand Down
Binary file added spec/fixtures/movies/file_with_http_in_name.flv
Binary file not shown.