Sha256: 404885c8a6c635d1ba447b18a3f6a1f8fbc0ee20582dd1eddb0333b4d288b050

Contents?: true

Size: 490 Bytes

Versions: 17

Compression:

Stored size: 490 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "helper"))

class JohnsonTest < Test::Unit::TestCase
  def test_shortcut_evaluate
    assert_equal(4, Johnson.evaluate("2 + 2"))
  end
  
  def test_can_provide_context_vars_to_evaluate
    assert_equal(4, Johnson.evaluate("2 + foo", :foo => 2))
  end
  
  def test_evaluate_uses_a_new_runtime_each_time
    assert_equal(4, Johnson.evaluate("foo", :foo => 4))
    assert_raise(Johnson::Error) { Johnson.evaluate("foo") }
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
jbarnette-johnson-1.0.0.200806240111 test/johnson_test.rb
jbarnette-johnson-1.0.0.200807291507 test/johnson_test.rb
jbarnette-johnson-1.0.0.200808062051 test/johnson_test.rb
jbarnette-johnson-1.0.0.200808062111 test/johnson_test.rb
jbarnette-johnson-1.0.0.200811251942 test/johnson_test.rb
jbarnette-johnson-1.0.0.20081126120511 test/johnson_test.rb
jbarnette-johnson-1.0.0.20090127202936 test/johnson_test.rb
jbarnette-johnson-1.0.0.20090225110820 test/johnson_test.rb
jbarnette-johnson-1.0.0.20090326122910 test/johnson_test.rb
jbarnette-johnson-1.0.0.20090326154650 test/johnson_test.rb
jbarnette-johnson-1.0.0.20090326161333 test/johnson_test.rb
jbarnette-johnson-1.0.0.20090402144841 test/johnson_test.rb
jbarnette-johnson-1.0.0.20090402155420 test/johnson_test.rb
johnson-1.2.0 test/johnson_test.rb
johnson-1.1.1 test/johnson_test.rb
johnson-1.1.2 test/johnson_test.rb
johnson-1.1.0 test/johnson_test.rb