Fix test that fails on 1.9 due to behaviour of String#start_with?

On ruby 1.9, the argument of String#start_with? does not automatically
get coerced into a string. In Homesick#clone, we use start_with? with a
Pathname instance, which now always returns false.
This commit is contained in:
Jacob Buys
2012-05-30 22:36:19 +02:00
parent e415da13e4
commit a141f9cbbd

View File

@@ -22,7 +22,7 @@ class Homesick < Thor
destination = nil destination = nil
if File.exist?(uri) if File.exist?(uri)
uri = Pathname.new(uri).expand_path uri = Pathname.new(uri).expand_path
if uri.to_s.start_with?(repos_dir) if uri.to_s.start_with?(repos_dir.to_s)
raise "Castle already cloned to #{uri}" raise "Castle already cloned to #{uri}"
end end