Permalink
Browse files

return nil instead of '' if bad version/selector

  • Loading branch information...
1 parent 9d2ddac commit 599ab64198721a36ed05804174e9e1808b518296 Jigish Patel committed Nov 8, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/quilt.rb
  2. +2 −2 test/quilt_test.rb
View
@@ -312,11 +312,11 @@ def get_version(name)
end
def stitch(selector, version_name, prefix = :default, dynamic_modules = nil)
- return '' if !selector
+ return nil if !selector
version = get_version(version_name)
if (!version)
log_error("could not fetch version: #{version_name}")
- return ''
+ return nil
end
outversion = version[prefix] || version[:default]
View
@@ -346,8 +346,8 @@ class QuiltTest < Scope::TestCase
end
context "stitch" do
- should "return empty for a non-existant version when no remote information exists" do
- assert_equal '', @no_remote_quilt.stitch(['0.js'], '2.0.0')
+ should "return nil for a non-existant version when no remote information exists" do
+ assert_equal nil, @no_remote_quilt.stitch(['0.js'], '2.0.0')
end
should "properly stitch for an existing version with selector array" do

0 comments on commit 599ab64

Please sign in to comment.