Sha256: 480b9eed6a0d5feb5a09b8f5ca9a1283452c434f112ea980dbaa6b33d5f5e9a5

Contents?: true

Size: 456 Bytes

Versions: 2

Compression:

Stored size: 456 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'shoulda'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'jsonpath'
 
class Test::Unit::TestCase
  
  private
  def assert_resolves(obj, path, result)
    assert_equal safe_sort(result), safe_sort(JsonPath.new(path).on(obj).to_a)
  end
  
  def safe_sort(objs)
    objs.sort_by do |obj|
      obj ? obj.to_s : 0.to_s
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jsonpath-0.1.2 test/test_helper.rb
jsonpath-0.1.0 test/test_helper.rb