aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/jsonpp.rb
blob: 4cdbf632dec4633c3c42c70b5bbb226b1e72ee86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'formula'

class Jsonpp < Formula
  homepage 'http://jmhodges.github.io/jsonpp/'
  url 'https://github.com/jmhodges/jsonpp/releases/v1.2.0/715/jsonpp-1.2.0-osx-x86_64.tar.gz'
  version '1.2.0'
  sha1 '422d5b2cefa92923d2fbef9afe1324d72134509e'

  def install
    bin.install 'jsonpp'
  end

  test do
    IO.popen("#{bin}/jsonpp", "w+") do |pipe|
      pipe.puts '{"foo":"bar","baz":"qux"}'
      pipe.close_write
      assert_equal <<-EOS.undent, pipe.read
        {
          "foo": "bar",
          "baz": "qux"
        }
      EOS
    end
  end
end