diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/rubygems/test_gem_config_file.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_stub_specification.rb | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb index 5077f37359..3ababfbbfd 100644 --- a/test/rubygems/test_gem_config_file.rb +++ b/test/rubygems/test_gem_config_file.rb @@ -416,7 +416,7 @@ if you believe they were disclosed to a third party. def test_ignore_invalid_config_file File.open @temp_conf, 'w' do |fp| - fp.puts "some-non-yaml-hash-string" + fp.puts "invalid: yaml:" end begin diff --git a/test/rubygems/test_gem_stub_specification.rb b/test/rubygems/test_gem_stub_specification.rb index e1ab8342dd..5488adc348 100644 --- a/test/rubygems/test_gem_stub_specification.rb +++ b/test/rubygems/test_gem_stub_specification.rb @@ -9,7 +9,9 @@ class TestStubSpecification < Gem::TestCase def setup super - @foo = Gem::StubSpecification.gemspec_stub FOO + @base_dir = File.dirname(SPECIFICATIONS) + @gems_dir = File.join File.dirname(SPECIFICATIONS), 'gem' + @foo = Gem::StubSpecification.gemspec_stub FOO, @base_dir, @gems_dir end def test_initialize @@ -31,7 +33,7 @@ class TestStubSpecification < Gem::TestCase end def test_initialize_missing_stubline - stub = Gem::StubSpecification.gemspec_stub(BAR) + stub = Gem::StubSpecification.gemspec_stub(BAR, @base_dir, @gems_dir) assert_equal "bar", stub.name assert_equal Gem::Version.new("0.0.2"), stub.version assert_equal Gem::Platform.new("ruby"), stub.platform @@ -118,7 +120,7 @@ class TestStubSpecification < Gem::TestCase io.write spec.to_ruby_for_cache end - default_spec = Gem::StubSpecification.gemspec_stub spec.loaded_from + default_spec = Gem::StubSpecification.gemspec_stub spec.loaded_from, spec.base_dir, spec.gems_dir refute default_spec.missing_extensions? end @@ -140,7 +142,7 @@ class TestStubSpecification < Gem::TestCase def test_to_spec_with_other_specs_loaded_does_not_warn real_foo = util_spec @foo.name, @foo.version real_foo.activate - bar = Gem::StubSpecification.gemspec_stub BAR + bar = Gem::StubSpecification.gemspec_stub BAR, real_foo.base_dir, real_foo.gems_dir refute_predicate Gem.loaded_specs, :empty? assert bar.to_spec end @@ -148,7 +150,7 @@ class TestStubSpecification < Gem::TestCase def test_to_spec_activated assert @foo.to_spec.is_a?(Gem::Specification) assert_equal "foo", @foo.to_spec.name - refute @foo.to_spec.instance_variable_defined? :@ignored + refute @foo.to_spec.instance_variable_get :@ignored end def test_to_spec_missing_extensions @@ -179,7 +181,7 @@ end io.flush - stub = Gem::StubSpecification.gemspec_stub io.path + stub = Gem::StubSpecification.gemspec_stub io.path, @gemhome, File.join(@gemhome, 'gems') yield stub if block_given? @@ -202,7 +204,7 @@ end io.flush - stub = Gem::StubSpecification.gemspec_stub io.path + stub = Gem::StubSpecification.gemspec_stub io.path, @gemhome, File.join(@gemhome, 'gems') yield stub if block_given? |