[DRE-commits] [SCM] gem2deb.git branch, master, updated. debian/0.2.3-48-gae05bb2
Antonio Terceiro
terceiro at softwarelivre.org
Sat Jul 9 05:51:13 UTC 2011
The following commit has been merged in the master branch:
commit 2c83a6a5397a9c38f9e09cdbb36ca2ba09f3cd1f
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date: Sun Jul 3 15:02:43 2011 -0700
Some minimal testing for Gem2Deb::ExtensionBuilder
+ rename some variables
diff --git a/lib/gem2deb/extension_builder.rb b/lib/gem2deb/extension_builder.rb
index bd09e6b..5efca0d 100644
--- a/lib/gem2deb/extension_builder.rb
+++ b/lib/gem2deb/extension_builder.rb
@@ -24,7 +24,8 @@ module Gem2Deb
include Gem2Deb
- attr_reader :extension, :destdir
+ attr_reader :extension
+ attr_reader :package
attr_reader :directory
def initialize(extension, pkg)
@@ -57,7 +58,7 @@ module Gem2Deb
exit(1)
end
begin
- target = File.expand_path(File.join('debian', @package, RbConfig::CONFIG['vendorarchdir']))
+ target = File.expand_path(File.join('debian', package, RbConfig::CONFIG['vendorarchdir']))
Dir.chdir(directory) do
rubygems_builder.build(extension, '.', target, results)
puts results
@@ -68,9 +69,9 @@ module Gem2Deb
end
end
- def self.build_all_extensions(destdir)
+ def self.build_all_extensions(package)
all_extensions.each do |extension|
- ext = new(extension, destdir)
+ ext = new(extension, package)
ext.clean
ext.build_and_install
end
diff --git a/test/helper/samples.rb b/test/helper/samples.rb
index 7054e2e..0aa90d6 100644
--- a/test/helper/samples.rb
+++ b/test/helper/samples.rb
@@ -29,9 +29,10 @@ class Gem2DebTestCase
SIMPLE_GIT = File.join(SAMPLE_DIR, 'simplegit')
- # Setup.rb
-
SIMPLE_SETUPRB_NAME = "simplesetuprb"
SIMPLE_SETUPRB_DIRNAME = SIMPLE_SETUPRB_NAME + "-0.0.1"
+
+ SIMPLE_EXTENSION_WITH_NAME_CLASH_NAME = 'simpleextension_with_name_clash'
+ SIMPLE_EXTENSION_WITH_NAME_CLASH_DIRNAME = SIMPLE_EXTENSION_WITH_NAME_CLASH_NAME.gsub('_', '-') + '-1.2.3'
end
end
diff --git a/test/unit/extension_builder_test.rb b/test/unit/extension_builder_test.rb
new file mode 100644
index 0000000..bcb5f24
--- /dev/null
+++ b/test/unit/extension_builder_test.rb
@@ -0,0 +1,28 @@
+require 'test_helper'
+require 'gem2deb/extension_builder'
+
+class ExtensionBuilderTest < Gem2DebTestCase
+
+ gem = SIMPLE_EXTENSION_WITH_NAME_CLASH_NAME
+ build_dir = 'ruby-' + SIMPLE_EXTENSION_WITH_NAME_CLASH_DIRNAME
+ target_dir = File.join(tmpdir, build_dir)
+ package = 'ruby-' + SIMPLE_EXTENSION_WITH_NAME_CLASH_NAME.gsub('_', '-')
+
+ one_time_setup do
+ FileUtils.cp_r(File.join('test/sample/', gem), target_dir)
+ Dir.chdir(target_dir) do
+ silence_stream STDOUT do
+ Gem2Deb::ExtensionBuilder.build_all_extensions(package)
+ end
+ end
+ end
+
+ context 'building simpleextension' do
+ should 'install .so for current Ruby' do
+ Dir.chdir(target_dir) do
+ assert_file_exists File.join('debian', package, RbConfig::CONFIG['vendorarchdir'] + '/simpleextension_with_name_clash.so')
+ end
+ end
+ end
+
+end
--
gem2deb.git
More information about the Pkg-ruby-extras-commits
mailing list