Kevin Clark | f85e793 | 2008-06-18 00:56:48 +0000 | [diff] [blame] | 1 | $:.unshift File.dirname(__FILE__) + '/gen-rb' |
| 2 | $:.unshift File.join(File.dirname(__FILE__), '../../lib/rb/lib') |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame^] | 3 | $:.unshift File.join(File.dirname(__FILE__), '../../lib/rb/ext') |
Kevin Clark | 28580f4 | 2008-06-18 00:49:17 +0000 | [diff] [blame] | 4 | |
| 5 | require 'test/unit' |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame^] | 6 | |
| 7 | module Thrift |
| 8 | module Struct |
| 9 | def ==(other) |
| 10 | return false unless other.is_a? self.class |
| 11 | self.class.const_get(:FIELDS).collect {|fid, data| data[:name] }.all? do |field| |
| 12 | send(field) == other.send(field) |
| 13 | end |
| 14 | end |
| 15 | end |
| 16 | end |