diff options
Diffstat (limited to 'test/unit/json.rb')
-rw-r--r-- | test/unit/json.rb | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/test/unit/json.rb b/test/unit/json.rb deleted file mode 100644 index 4e44a64..0000000 --- a/test/unit/json.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'test/unit' -require 'coderay' - -class JSONEncoderTest < Test::Unit::TestCase - - def test_json_output - old_load_paths = $:.dup - begin - $:.delete '.' - $:.delete File.dirname(__FILE__) - json = CodeRay.scan('puts "Hello world!"', :ruby).json - assert_equal [ - {"type"=>"text", "text"=>"puts", "kind"=>"ident"}, - {"type"=>"text", "text"=>" ", "kind"=>"space"}, - {"type"=>"block", "action"=>"open", "kind"=>"string"}, - {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"}, - {"type"=>"text", "text"=>"Hello world!", "kind"=>"content"}, - {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"}, - {"type"=>"block", "action"=>"close", "kind"=>"string"}, - ], JSON.load(json) - ensure - for path in old_load_paths - $: - $: << path - end - end - end - -end
\ No newline at end of file |