Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removing relative requires

  • Loading branch information...
commit cd61cb9c3b7055edc5376b9c2618842230784956 1 parent 7c38ad1
Aaron Patterson tenderlove authored
Showing with 68 additions and 68 deletions.
  1. +5 −5 test/helper.rb
  2. +1 −1  test/johnson/browser_test.rb
  3. +1 −1  test/johnson/conversions/array_test.rb
  4. +1 −1  test/johnson/conversions/boolean_test.rb
  5. +1 −1  test/johnson/conversions/callable_test.rb
  6. +1 −1  test/johnson/conversions/file_test.rb
  7. +1 −1  test/johnson/conversions/nil_test.rb
  8. +1 −1  test/johnson/conversions/number_test.rb
  9. +1 −1  test/johnson/conversions/regexp_test.rb
  10. +1 −1  test/johnson/conversions/string_test.rb
  11. +1 −1  test/johnson/conversions/struct_test.rb
  12. +1 −1  test/johnson/conversions/symbol_test.rb
  13. +1 −1  test/johnson/conversions/thread_test.rb
  14. +1 −1  test/johnson/custom_conversions_test.rb
  15. +1 −1  test/johnson/error_test.rb
  16. +9 −9 test/johnson/extensions_test.rb
  17. +1 −1  test/johnson/nodes/array_literal_test.rb
  18. +1 −1  test/johnson/nodes/array_node_test.rb
  19. +1 −1  test/johnson/nodes/binary_node_test.rb
  20. +1 −1  test/johnson/nodes/bracket_access_test.rb
  21. +1 −1  test/johnson/nodes/delete_test.rb
  22. +1 −1  test/johnson/nodes/do_while_test.rb
  23. +1 −1  test/johnson/nodes/dot_accessor_test.rb
  24. +1 −1  test/johnson/nodes/export_test.rb
  25. +1 −1  test/johnson/nodes/for_test.rb
  26. +1 −1  test/johnson/nodes/function_test.rb
  27. +1 −1  test/johnson/nodes/if_test.rb
  28. +1 −1  test/johnson/nodes/import_test.rb
  29. +1 −1  test/johnson/nodes/label_test.rb
  30. +1 −1  test/johnson/nodes/let_test.rb
  31. +1 −1  test/johnson/nodes/object_literal_test.rb
  32. +1 −1  test/johnson/nodes/return_test.rb
  33. +1 −1  test/johnson/nodes/semi_test.rb
  34. +1 −1  test/johnson/nodes/switch_test.rb
  35. +1 −1  test/johnson/nodes/ternary_test.rb
  36. +1 −1  test/johnson/nodes/throw_test.rb
  37. +1 −1  test/johnson/nodes/try_node_test.rb
  38. +1 −1  test/johnson/nodes/typeof_test.rb
  39. +1 −1  test/johnson/nodes/unary_node_test.rb
  40. +1 −1  test/johnson/nodes/void_test.rb
  41. +1 −1  test/johnson/nodes/while_test.rb
  42. +1 −1  test/johnson/nodes/with_test.rb
  43. +1 −1  test/johnson/prelude_test.rb
  44. +1 −1  test/johnson/runtime_test.rb
  45. +1 −1  test/johnson/spidermonkey/context_test.rb
  46. +1 −1  test/johnson/spidermonkey/immutable_node_test.rb
  47. +1 −1  test/johnson/spidermonkey/js_land_proxy_test.rb
  48. +1 −1  test/johnson/spidermonkey/ruby_land_proxy_test.rb
  49. +1 −1  test/johnson/spidermonkey/runtime_test.rb
  50. +1 −1  test/johnson/version_test.rb
  51. +1 −1  test/johnson/visitors/dot_visitor_test.rb
  52. +1 −1  test/johnson/visitors/enumerating_visitor_test.rb
  53. +3 −3 test/johnson_test.rb
  54. +1 −1  test/parser_test.rb
10 test/helper.rb
View
@@ -29,12 +29,12 @@ def setup
#@runtime.delegate.gc_zeal = 2
#@runtime.delegate.debugger = Johnson::SpiderMonkey::Debugger.new(TestLogger.new)
end
-
+
def assert_js(expression, options={})
runtime = options[:runtime] || @runtime
assert(runtime.evaluate(expression), "Expected JS expression [#{expression}] to be true.")
end
-
+
def assert_js_equal(expected, expression, options={})
runtime = options.delete(:runtime) || @runtime
options.each { |k, v| runtime[k.to_s] = v }
@@ -45,13 +45,13 @@ def assert_js_equal(expected, expression, options={})
class NodeTestCase < Test::Unit::TestCase
include GCTearDown
include Johnson::Nodes
-
+
undef :default_test if method_defined? :default_test
-
+
def setup
@parser = Johnson::Parser
end
-
+
def assert_sexp(expected, actual)
assert_equal(expected, actual.to_sexp)
end
2  test/johnson/browser_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../helper"))
+require "helper"
begin
require "xml/dom/builder"
2  test/johnson/conversions/array_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module Conversions
2  test/johnson/conversions/boolean_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module Conversions
2  test/johnson/conversions/callable_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module Conversions
2  test/johnson/conversions/file_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module Conversions
2  test/johnson/conversions/nil_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module Conversions
2  test/johnson/conversions/number_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module Conversions
2  test/johnson/conversions/regexp_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module Conversions
2  test/johnson/conversions/string_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module Conversions
2  test/johnson/conversions/struct_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module Conversions
2  test/johnson/conversions/symbol_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module Conversions
2  test/johnson/conversions/thread_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module Conversions
2  test/johnson/custom_conversions_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../helper"))
+require "helper"
module Johnson
class CustomConversionsTest < Johnson::TestCase
2  test/johnson/error_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../helper"))
+require "helper"
module Johnson
class ErrorTest < Johnson::TestCase
18 test/johnson/extensions_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../helper"))
+require "helper"
module Johnson
module Extensions
@@ -6,13 +6,13 @@ class DefinePropertyTest < Johnson::TestCase
def setup
super
@runtime.evaluate("x = {}")
- end
-
+ end
+
def test_object_can_define_property
@runtime.evaluate("Object.defineProperty(x, 'answer', 42)")
assert_js_equal(42, "x.answer")
end
-
+
def test_object_can_define_unenumerable_property
@runtime.evaluate("Object.defineProperty(x, 'answer', 42)")
@runtime.evaluate <<-JS
@@ -21,7 +21,7 @@ def test_object_can_define_unenumerable_property
JS
assert_js("y.length == 0")
end
-
+
def test_object_can_define_enumerable_property
@runtime.evaluate("Object.defineProperty(x, 'answer', 42, Object.ITERABLE)")
@runtime.evaluate <<-JS
@@ -30,27 +30,27 @@ def test_object_can_define_enumerable_property
JS
assert_js("y.length == 1")
end
-
+
def test_object_can_define_read_only_property
@runtime.evaluate("Object.defineProperty(x, 'answer', 42, Object.READ_ONLY)")
@runtime.evaluate("x.answer = 47")
assert_js_equal(42, "x.answer")
end
-
+
def test_object_can_define_non_deletable_property
@runtime.evaluate("Object.defineProperty(x, 'answer', 42, Object.NON_DELETABLE)")
@runtime.evaluate("r = (delete x.answer)")
assert_js_equal(false, "r")
assert_js_equal(42, "x.answer")
end
-
+
def test_object_can_define_mixed_property
@runtime.evaluate("Object.defineProperty(x, 'answer', 42, Object.NON_DELETABLE | Object.READ_ONLY)")
@runtime.evaluate("r = (delete x.answer)")
@runtime.evaluate("x.answer = 47")
assert_js_equal(false, "r")
assert_js_equal(42, "x.answer")
- end
+ end
end
end
end
2  test/johnson/nodes/array_literal_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class ArrayLiteralNodeTest < Johnson::NodeTestCase
def test_array_literal
2  test/johnson/nodes/array_node_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class ArrayNodeTest < Johnson::NodeTestCase
def test_function_call
2  test/johnson/nodes/binary_node_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class BinaryNodeTest < Johnson::NodeTestCase
{
2  test/johnson/nodes/bracket_access_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class BracketAccessTest < Johnson::NodeTestCase
def test_to_sexp
2  test/johnson/nodes/delete_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class DeleteNodeTest < Johnson::NodeTestCase
def test_delete_sexp
2  test/johnson/nodes/do_while_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class DoWhileTest < Johnson::NodeTestCase
def test_do_while
2  test/johnson/nodes/dot_accessor_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class DotAccessorTest < Johnson::NodeTestCase
def test_expression_statement
2  test/johnson/nodes/export_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class ExportTest < Johnson::NodeTestCase
def test_export
2  test/johnson/nodes/for_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class ForTest < Johnson::NodeTestCase
def test_empty_for
2  test/johnson/nodes/function_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class FunctionTest < Johnson::NodeTestCase
def test_anon_function_no_args_to_sexp
2  test/johnson/nodes/if_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class IfTest < Johnson::NodeTestCase
def test_if_no_else
2  test/johnson/nodes/import_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class ImportTest < Johnson::NodeTestCase
def test_import
2  test/johnson/nodes/label_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class LabelTest < Johnson::NodeTestCase
def test_label_statement_to_sexp
2  test/johnson/nodes/let_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class LetNodeTest < Johnson::NodeTestCase
def test_let_to_sexp
2  test/johnson/nodes/object_literal_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class ObjectLiteralTest < Johnson::NodeTestCase
def test_object_literal
2  test/johnson/nodes/return_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class ReturnTest < Johnson::NodeTestCase
def test_return
2  test/johnson/nodes/semi_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class SemiTest < Johnson::NodeTestCase
def test_null_semi
2  test/johnson/nodes/switch_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class SwitchTest < Johnson::NodeTestCase
def test_empty_switch
2  test/johnson/nodes/ternary_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class TernaryNodeTest < Johnson::NodeTestCase
def test_ternary
2  test/johnson/nodes/throw_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class ThrowTest < Johnson::NodeTestCase
def test_to_sexp
2  test/johnson/nodes/try_node_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class TryTest < Johnson::NodeTestCase
def test_try_finally
2  test/johnson/nodes/typeof_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class TypeofNodeTest < Johnson::NodeTestCase
def test_typeof_sexp
2  test/johnson/nodes/unary_node_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class UnaryNodeTest < Johnson::NodeTestCase
def test_u_positive_sexp
2  test/johnson/nodes/void_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class VoidNodeTest < Johnson::NodeTestCase
def test_delete_sexp
2  test/johnson/nodes/while_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class WhileTest < Johnson::NodeTestCase
def test_while
2  test/johnson/nodes/with_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class WithTest < Johnson::NodeTestCase
def test_with
2  test/johnson/prelude_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../helper"))
+require "helper"
module Johnson
class PreludeTest < Johnson::TestCase
2  test/johnson/runtime_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../helper"))
+require "helper"
require 'tempfile'
module Johnson
2  test/johnson/spidermonkey/context_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module SpiderMonkey
2  test/johnson/spidermonkey/immutable_node_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
require 'stringio'
2  test/johnson/spidermonkey/js_land_proxy_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module SpiderMonkey
2  test/johnson/spidermonkey/ruby_land_proxy_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module SpiderMonkey
2  test/johnson/spidermonkey/runtime_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
module Johnson
module SpiderMonkey
2  test/johnson/version_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../helper"))
+require "helper"
module Johnson
class VersionTest < Johnson::TestCase
2  test/johnson/visitors/dot_visitor_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class DotVisitorTest < Test::Unit::TestCase
def test_var_foo
2  test/johnson/visitors/enumerating_visitor_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))
+require "helper"
class EnumeratingVisitorTest < Test::Unit::TestCase
def test_for
6 test/johnson_test.rb
View
@@ -1,14 +1,14 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "helper"))
+require "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") }
2  test/parser_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "helper"))
+require "helper"
require 'stringio'
class ParserTest < Test::Unit::TestCase
Please sign in to comment.
Something went wrong with that request. Please try again.