Files
btc_wire_proto/spec/spec_helper.rb
2011-06-04 22:53:33 +01:00

11 lines
243 B
Ruby

require 'rspec'
$: << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
def binary(str_ary)
str_ary.collect do |d|
raise ArgumentError.new("Bad part") unless d =~ /\A[a-f0-9]{2}\Z/i
d.to_i(16).chr
end.join("")
end