aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_specification.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_specification.rb')
-rw-r--r--test/rubygems/test_gem_specification.rb50
1 files changed, 45 insertions, 5 deletions
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index 7aa9d5aeb1..b72a5d1baf 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -999,8 +999,8 @@ dependencies: []
assert_equal 'summary', spec.summary
assert_same spec.summary, new_spec.summary
- assert_equal %w[lib/file.rb test/file.rb bin/exec README.txt
- ext/extconf.rb].sort,
+ assert_equal %w[README.txt bin/exec ext/extconf.rb lib/file.rb
+ test/file.rb].sort,
spec.files
refute_same spec.files, new_spec.files, 'files'
@@ -1109,7 +1109,31 @@ dependencies: []
@a2.executable = 'app'
assert_equal nil, @a2.bindir
- assert_equal %w[lib/code.rb app].sort, @a2.files
+ assert_equal %w[app lib/code.rb].sort, @a2.files
+ end
+
+ def test_extensions_equals_nil
+ @a2.instance_variable_set(:@extensions, nil)
+ assert_equal nil, @a2.instance_variable_get(:@extensions)
+ assert_equal %w[lib/code.rb], @a2.files
+ end
+
+ def test_test_files_equals_nil
+ @a2.instance_variable_set(:@test_files, nil)
+ assert_equal nil, @a2.instance_variable_get(:@test_files)
+ assert_equal %w[lib/code.rb], @a2.files
+ end
+
+ def test_executables_equals_nil
+ @a2.instance_variable_set(:@executables, nil)
+ assert_equal nil, @a2.instance_variable_get(:@executables)
+ assert_equal %w[lib/code.rb], @a2.files
+ end
+
+ def test_extra_rdoc_files_equals_nil
+ @a2.instance_variable_set(:@extra_rdoc_files, nil)
+ assert_equal nil, @a2.instance_variable_get(:@extra_rdoc_files)
+ assert_equal %w[lib/code.rb], @a2.files
end
def test_build_extensions
@@ -1437,7 +1461,7 @@ dependencies: []
def test_executable_equals
@a2.executable = 'app'
assert_equal 'app', @a2.executable
- assert_equal %w[lib/code.rb bin/app].sort, @a2.files
+ assert_equal %w[bin/app lib/code.rb].sort, @a2.files
end
def test_extensions
@@ -1785,6 +1809,22 @@ dependencies: []
assert_kind_of Gem::Source::Installed, @a1.source
end
+ def test_source_paths
+ ext_spec
+
+ @ext.require_paths = %w[lib ext foo]
+ @ext.extensions << 'bar/baz'
+
+ expected = %w[
+ lib
+ ext
+ foo
+ bar
+ ]
+
+ assert_equal expected, @ext.source_paths
+ end
+
def test_full_require_paths
ext_spec
@@ -2435,7 +2475,7 @@ duplicate dependency on b (>= 1.2.3), (~> 1.2) use:
assert_equal '["lib2"] are not files', e.message
end
- assert_equal %w[lib/code.rb test/suite.rb bin/exec ext/a/extconf.rb lib2].sort,
+ assert_equal %w[bin/exec ext/a/extconf.rb lib/code.rb lib2 test/suite.rb].sort,
@a1.files
end