summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_source_specific_file.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_source_specific_file.rb')
-rw-r--r--test/rubygems/test_gem_source_specific_file.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_source_specific_file.rb b/test/rubygems/test_gem_source_specific_file.rb
new file mode 100644
index 0000000..7ffcf48
--- /dev/null
+++ b/test/rubygems/test_gem_source_specific_file.rb
@@ -0,0 +1,33 @@
+require 'rubygems/test_case'
+require 'rubygems/source_specific_file'
+
+class TestGemSourceSpecificFile < Gem::TestCase
+ def setup
+ super
+
+ @a, @a_gem = util_gem "a", '1'
+ @sf = Gem::Source::SpecificFile.new(@a_gem)
+ end
+
+ def test_spec
+ assert_equal @a, @sf.spec
+ end
+
+ def test_load_specs
+ assert_equal [@a.name_tuple], @sf.load_specs
+ end
+
+ def test_fetch_spec
+ assert_equal @a, @sf.fetch_spec(@a.name_tuple)
+ end
+
+ def test_fetch_spec_fails_on_unknown_name
+ assert_raises Gem::Exception do
+ @sf.fetch_spec(nil)
+ end
+ end
+
+ def test_download
+ assert_equal @a_gem, @sf.download(@a)
+ end
+end