Skip to content
This repository
Browse code

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

…ependency tests.
  • Loading branch information...
commit 1642b2362ecd627c5bdd9965ff3d527a95e2b244 1 parent 1a29a67
Joshua Peek josh authored
4 railties/lib/rails/gem_dependency.rb
@@ -13,11 +13,9 @@ def initialize(name, options = {})
13 13 @requirement = options[:requirement]
14 14 elsif options[:version]
15 15 @requirement = Gem::Requirement.create(options[:version])
16   - else
17   - raise ArgumentError.new('Must pass either :version or :requirement')
18 16 end
19 17
20   - @version = @requirement.instance_variable_get("@requirements").first.last if @requirement
  18 + @version = @requirement.instance_variable_get("@requirements").first.last if @requirement
21 19 @name = name.to_s
22 20 @lib = options[:lib]
23 21 @source = options[:source]
4 railties/test/gem_dependency_test.rb
... ... @@ -1,5 +1,9 @@
1 1 require 'plugin_test_helper'
2 2
  3 +class Rails::GemDependency
  4 + public :install_command, :unpack_command
  5 +end
  6 +
3 7 uses_mocha "Plugin Tests" do
4 8 class GemDependencyTest < Test::Unit::TestCase
5 9 def setup

0 comments on commit 1642b23

Please sign in to comment.
Something went wrong with that request. Please try again.