1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Additional tests for the gem subsystem

* test_gem_ignores_development_dependencies
  * test_gem_guards_against_duplicate_unpacks
  * test_gem_does_not_unpack_framework_gems

[#2236 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
David Dollar 2009-04-29 10:04:17 -04:00 committed by Jeremy Kemper
parent d6c584618f
commit 7149ddd2a1
5 changed files with 101 additions and 0 deletions

View file

@ -145,6 +145,27 @@ class GemDependencyTest < Test::Unit::TestCase
end
end
def test_gem_ignores_development_dependencies
dummy_gem = Rails::GemDependency.new "dummy-gem-k"
dummy_gem.add_load_paths
dummy_gem.load
assert_equal 1, dummy_gem.dependencies.size
end
def test_gem_guards_against_duplicate_unpacks
dummy_gem = Rails::GemDependency.new "dummy-gem-a"
dummy_gem.stubs(:frozen?).returns(true)
dummy_gem.expects(:unpack_base).never
dummy_gem.unpack
end
def test_gem_does_not_unpack_framework_gems
dummy_gem = Rails::GemDependency.new "dummy-gem-a"
dummy_gem.stubs(:framework_gem?).returns(true)
dummy_gem.expects(:unpack_base).never
dummy_gem.unpack
end
def test_gem_from_directory_name
dummy_gem = Rails::GemDependency.from_directory_name('dummy-gem-1.1')
assert_equal 'dummy-gem', dummy_gem.name

View file

@ -0,0 +1,29 @@
--- !ruby/object:Gem::Specification
name: dummy-gem-h
version: !ruby/object:Gem::Version
version: 1.3.0
platform: ruby
authors:
- "Nobody"
date: 2008-10-03 00:00:00 -04:00
dependencies:
files:
- lib
- lib/dummy-gem-h.rb
require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: "0"
version:
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: "0"
version:
requirements: []
specification_version: 2
summary: Dummy Gem H

View file

@ -0,0 +1 @@
DUMMY_GEM_H_VERSION="1.0.0"

View file

@ -0,0 +1,49 @@
--- !ruby/object:Gem::Specification
name: dummy-gem-k
version: !ruby/object:Gem::Version
version: 1.3.0
platform: ruby
authors:
- "Nobody"
date: 2008-10-03 00:00:00 -04:00
dependencies:
- !ruby/object:Gem::Dependency
name: dummy-gem-k
type: :runtime
version_requirement:
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: 1.0.0
version:
- !ruby/object:Gem::Dependency
name: dummy-gem-h
type: :development
version_requirement:
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: 1.0.0
version:
files:
- lib
- lib/dummy-gem-k.rb
require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: "0"
version:
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: "0"
version:
requirements: []
specification_version: 2
summary: Dummy Gem I

View file

@ -0,0 +1 @@
DUMMY_GEM_K_VERSION="1.0.0"