Sha256: ad5cbb7c7721deec21570eccfc1e3f5963456cb6b1f3e81b8445617e288494ad

Contents?: true

Size: 537 Bytes

Versions: 12

Compression:

Stored size: 537 Bytes

Contents

class TestJsonpathBin < MiniTest::Unit::TestCase
  def setup
    @runner = "ruby -Ilib bin/jsonpath"
    @original_dir = Dir.pwd
    Dir.chdir(File.join(File.dirname(__FILE__), '..'))
  end

  def teardown
    Dir.chdir(@original_dir)
    `rm /tmp/test.json`
  end

  def test_stdin
    assert_equal '["time"]', `echo '{"test": "time"}' | #{@runner} '$.test'`.strip
  end

  def test_stdin
    File.open('/tmp/test.json', 'w'){|f| f << '{"test": "time"}'}
    assert_equal '["time"]', `#{@runner} '$.test' /tmp/test.json`.strip
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
jsonpath-0.5.8 test/test_jsonpath_bin.rb
jsonpath-0.5.7 test/test_jsonpath_bin.rb
jsonpath-0.5.6 test/test_jsonpath_bin.rb
jsonpath-0.5.5 test/test_jsonpath_bin.rb
jsonpath-0.5.4 test/test_jsonpath_bin.rb
jsonpath-0.5.3 test/test_jsonpath_bin.rb
jsonpath-0.5.2 test/test_jsonpath_bin.rb
jsonpath-0.5.1 test/test_jsonpath_bin.rb
jsonpath-0.5.0 test/test_jsonpath_bin.rb
jsonpath-0.4.2 test/test_jsonpath_bin.rb
jsonpath-0.4.1 test/test_jsonpath_bin.rb
jsonpath-0.4.0 test/test_jsonpath_bin.rb