Fix method signature

This commit is contained in:
Jack Nagel 2014-07-10 12:38:09 -05:00
parent 2b9cfe9fa5
commit 126d2133ab
2 changed files with 6 additions and 6 deletions

View File

@ -3,8 +3,8 @@ require 'stringio'
require 'erb' require 'erb'
class Patch class Patch
def self.create(strip, io=nil, &block) def self.create(strip, io, &block)
case strip ||= :p1 case strip
when :DATA, IO, StringIO when :DATA, IO, StringIO
IOPatch.new(strip, :p1) IOPatch.new(strip, :p1)
when String when String

View File

@ -3,7 +3,7 @@ require 'patch'
class PatchTests < Homebrew::TestCase class PatchTests < Homebrew::TestCase
def test_create_simple def test_create_simple
patch = Patch.create(:p2) patch = Patch.create(:p2, nil)
assert_kind_of ExternalPatch, patch assert_kind_of ExternalPatch, patch
assert_predicate patch, :external? assert_predicate patch, :external?
assert_equal :p2, patch.strip assert_equal :p2, patch.strip
@ -17,7 +17,7 @@ class PatchTests < Homebrew::TestCase
end end
def test_create_io_without_strip def test_create_io_without_strip
patch = Patch.create(StringIO.new("foo")) patch = Patch.create(StringIO.new("foo"), nil)
assert_kind_of IOPatch, patch assert_kind_of IOPatch, patch
assert_equal :p1, patch.strip assert_equal :p1, patch.strip
end end
@ -29,7 +29,7 @@ class PatchTests < Homebrew::TestCase
end end
def test_create_string_without_strip def test_create_string_without_strip
patch = Patch.create("foo") patch = Patch.create("foo", nil)
assert_kind_of IOPatch, patch assert_kind_of IOPatch, patch
assert_equal :p1, patch.strip assert_equal :p1, patch.strip
end end
@ -41,7 +41,7 @@ class PatchTests < Homebrew::TestCase
end end
def test_create_DATA_without_strip def test_create_DATA_without_strip
patch = Patch.create(:DATA) patch = Patch.create(:DATA, nil)
assert_kind_of IOPatch, patch assert_kind_of IOPatch, patch
assert_equal :p1, patch.strip assert_equal :p1, patch.strip
end end