Permalink
Browse files

fix jruby and scala tests

  • Loading branch information...
1 parent 6658635 commit 366913cd969c0938276068ed87bb6733977ff998 @godfat committed Dec 13, 2010
Showing with 11 additions and 5 deletions.
  1. +3 −1 bin/ruby.scala
  2. +1 −1 bin/ruby.sh
  3. +7 −3 src/org/spbk/rb/core-set.rb
View
@@ -11,4 +11,6 @@ jruby.eval("require 'src/org/spbk/rb/core-set'")
val context: ScriptContext = jruby.getContext
context.setAttribute("input", "20", ScriptContext.ENGINE_SCOPE)
-println(jruby.eval("$input", context))
+
+println("20" == jruby.eval("$input", context).toString)
+println("85" == jruby.eval("$health", context).toString)
View
@@ -1,7 +1,7 @@
#!/bin/sh
scala -cp \
-.:jruby-engine.jar:/opt/local/share/java/jruby/lib/jruby.jar \
+.:jruby-engine.jar:/usr/local/Cellar/jruby/1.5.6/jruby/lib/jruby.jar \
bin/ruby.scala
jruby -r java src/org/spbk/rb/core-set.rb
@@ -1,15 +1,17 @@
-require '/opt/local/share/scala/lib/scala-library.jar'
+require '/usr/local/Cellar/scala/2.8.1/libexec/lib/scala-library.jar'
require 'build/lib/spellbook-core.jar'
+require 'java'
java_import 'scala.collection.immutable.List'
+
%w[ Creature Fire State Health Mana Energy Vigor Strength Constitution
Imagination Will Agility AttackMelee ].each{ |klass|
java_import "org.spbk.pure.#{klass}"
}
def cons list, value
- list.send(:'$colon$colon__method', value)
+ list.send(:'$colon$colon', value)
end
def array2list array
@@ -31,4 +33,6 @@ def array2list array
array2list([AttackMelee.new]),
List.empty)
-puts $footman.send(:'$minus', Health.new(15)).state.health.pt # 85
+$health = $footman.send(:'$minus', Health.new(15)).state.health.pt
+
+puts 85 == $health if $PROGRAM_NAME == 'src/org/spbk/rb/core-set.rb'

0 comments on commit 366913c

Please sign in to comment.