diff options
| author | Adam Vandenberg | 2014-07-27 16:23:54 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2014-07-27 16:23:54 -0700 |
| commit | a483bcbc929c4e2172906673288139c55bd591c8 (patch) | |
| tree | ef19fa936b1031d4e572799f6267f8f08bd1444d /Library/Formula | |
| parent | 38e99436dd27902250c08c69d22ac5b0d057f2cc (diff) | |
| download | homebrew-a483bcbc929c4e2172906673288139c55bd591c8.tar.bz2 | |
use binwrite in tests
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/yara.rb | 4 | ||||
| -rw-r--r-- | Library/Formula/z80dasm.rb | 2 | ||||
| -rw-r--r-- | Library/Formula/zxcc.rb | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/Library/Formula/yara.rb b/Library/Formula/yara.rb index 0678a8676..cb04a97d3 100644 --- a/Library/Formula/yara.rb +++ b/Library/Formula/yara.rb @@ -39,9 +39,7 @@ class Yara < Formula EOS program = testpath/"zero.prg" - File.open(program, "wb") do |f| - f.write [0x00, 0xc0, 0xa9, 0x30, 0x4c, 0xd2, 0xff].pack("C*") - end + program.binwrite [0x00, 0xc0, 0xa9, 0x30, 0x4c, 0xd2, 0xff].pack("C*") out = `#{bin}/yara #{rules} #{program}` assert_equal "chrout #{program}\n", out diff --git a/Library/Formula/z80dasm.rb b/Library/Formula/z80dasm.rb index 3721ca3aa..b08455260 100644 --- a/Library/Formula/z80dasm.rb +++ b/Library/Formula/z80dasm.rb @@ -12,7 +12,7 @@ class Z80dasm < Formula test do path = testpath/"a.bin" - path.open("wb") { |f| f.write [0xcd, 0x34, 0x12].pack("c*") } + path.binwrite [0xcd, 0x34, 0x12].pack("c*") output = `#{bin}/z80dasm #{path}`.strip assert output.include?("call 01234h") diff --git a/Library/Formula/zxcc.rb b/Library/Formula/zxcc.rb index 0a03bf3e5..446a3dc9d 100644 --- a/Library/Formula/zxcc.rb +++ b/Library/Formula/zxcc.rb @@ -23,7 +23,7 @@ class Zxcc < Formula ].pack("c*") path = testpath/"hello.com" - path.open("wb") { |f| f.write code } + path.binwrite code output = `#{bin}/zxcc #{path}`.strip assert_equal "Hello", output |
