Permalink
Browse files

Fix defaults for generator

git-svn-id: http://mkrf.rubyforge.org/svn/trunk@45 6e48df83-f314-0410-b1e7-e69642b30866
  • Loading branch information...
1 parent e27b45a commit 47a001e300a2b5c26eeb04552beee64fa56304b5 kevinclark committed Oct 18, 2006
Showing with 22 additions and 0 deletions.
  1. +1 −0 CHANGELOG
  2. +21 −0 test/unit/test_generator.rb
View
@@ -1,4 +1,5 @@
= svn
+* [FIXED] Defaults on Generator work again. [44]
= 0.1.2 10/4/06
* [CLEAN-UP] Removed useless add_source from Generator. We've got a constructor for that. [35]
@@ -1,4 +1,5 @@
require File.dirname(__FILE__) + '/../abstract_unit'
+require 'rbconfig'
# stubb this out so we don't overwrite our test rakefile
module Mkrf
@@ -116,4 +117,24 @@ def spec_code
end
SPEC
end
+end
+
+class TestGeneratorDefaults < Test::Unit::TestCase
+ def setup
+ @generator = Mkrf::Generator.new('trivial_lib')
+ end
+
+ def test_should_default_objects_to_empty_string
+ assert_equal '', @generator.objects
+ end
+
+ def test_should_default_ldshared_to_empty_string
+ assert_equal '', @generator.ldshared
+ end
+
+ def test_should_default_cflags_properly
+ expected = "#{Config::CONFIG['CCDLFLAGS']} #{Config::CONFIG['CFLAGS']} #{Config::CONFIG['ARCH_FLAG']}"
+ assert_equal expected, @generator.cflags
+ end
+
end

0 comments on commit 47a001e

Please sign in to comment.