Permalink
Browse files

Gem dependencies don't require a version. Also fixed up failing gem d…

…ependency tests.
  • Loading branch information...
1 parent 1a29a67 commit 1642b2362ecd627c5bdd9965ff3d527a95e2b244 @josh josh committed Apr 21, 2008
Showing with 5 additions and 3 deletions.
  1. +1 −3 railties/lib/rails/gem_dependency.rb
  2. +4 −0 railties/test/gem_dependency_test.rb
View
4 railties/lib/rails/gem_dependency.rb
@@ -13,11 +13,9 @@ def initialize(name, options = {})
@requirement = options[:requirement]
elsif options[:version]
@requirement = Gem::Requirement.create(options[:version])
- else
- raise ArgumentError.new('Must pass either :version or :requirement')
end
- @version = @requirement.instance_variable_get("@requirements").first.last if @requirement
+ @version = @requirement.instance_variable_get("@requirements").first.last if @requirement
@name = name.to_s
@lib = options[:lib]
@source = options[:source]
View
4 railties/test/gem_dependency_test.rb
@@ -1,5 +1,9 @@
require 'plugin_test_helper'
+class Rails::GemDependency
+ public :install_command, :unpack_command
+end
+
uses_mocha "Plugin Tests" do
class GemDependencyTest < Test::Unit::TestCase
def setup

0 comments on commit 1642b23

Please sign in to comment.