test/wolverine/script_test.rb in wolverine-0.2.1 vs test/wolverine/script_test.rb in wolverine-0.2.2

- old
+ new

@@ -21,13 +21,14 @@ begin script = Wolverine::Script.new(file) script.instance_variable_set("@content", "asdfasdfasdf+31f") script.instance_variable_set("@digest", "79437f5edda13f9c1669b978dd7a9066dd2059f1") script.call(Redis.new) - rescue Wolverine::LuaCompilationError => e + rescue Wolverine::LuaError => e assert_equal "'=' expected near '+'", e.message - assert_equal "e/file1.lua:1", e.backtrace.first + assert_equal "/a/b/c/d/e/file1.lua:1", e.backtrace.first + assert_match /script.rb/, e.backtrace[1] end end def test_runtime_error base = Pathname.new('/a/b/c/d') @@ -36,12 +37,13 @@ begin script = Wolverine::Script.new(file) script.instance_variable_set("@content", "return nil > 3") script.instance_variable_set("@digest", "39437f5edda13f9c1669b978dd7a9066dd2059f1") script.call(Redis.new) - rescue Wolverine::LuaRuntimeError => e + rescue Wolverine::LuaError => e assert_equal "attempt to compare number with nil", e.message - assert_equal "e/file1.lua:1", e.backtrace.first + assert_equal "/a/b/c/d/e/file1.lua:1", e.backtrace.first + assert_match /script.rb/, e.backtrace[1] end end def test_digest_and_content content = "return 1"