2010-01-20 16:58:56 +00:00
|
|
|
require 'rubygems'
|
|
|
|
require 'test/unit'
|
|
|
|
require 'shoulda'
|
2010-01-27 22:19:32 +00:00
|
|
|
require 'tmpdir'
|
2010-01-20 16:58:56 +00:00
|
|
|
|
|
|
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
|
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
|
|
require 'hydra'
|
|
|
|
|
|
|
|
class Test::Unit::TestCase
|
2010-01-29 19:56:02 +00:00
|
|
|
def target_file
|
2010-02-03 21:03:16 +00:00
|
|
|
File.expand_path(File.join(Dir.tmpdir, 'hydra_test.txt'))
|
2010-01-29 19:56:02 +00:00
|
|
|
end
|
2010-01-27 20:19:48 +00:00
|
|
|
|
2010-01-29 19:56:02 +00:00
|
|
|
def test_file
|
2010-02-03 21:03:16 +00:00
|
|
|
File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'write_file.rb'))
|
2010-01-29 19:56:02 +00:00
|
|
|
end
|
|
|
|
end
|
2010-01-29 18:01:53 +00:00
|
|
|
|
2010-01-27 20:19:48 +00:00
|
|
|
module Hydra #:nodoc:
|
|
|
|
module Messages #:nodoc:
|
|
|
|
class TestMessage < Hydra::Message
|
|
|
|
attr_accessor :text
|
|
|
|
def initialize(opts = {})
|
|
|
|
@text = opts.fetch(:text){ "test" }
|
|
|
|
end
|
|
|
|
def serialize
|
|
|
|
super(:text => @text)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|