Sha256: 7edaa639d09ad455ea9791529e6a26cd966979d3bed997418e5a5f295bb4a288
Contents?: true
Size: 1.32 KB
Versions: 6
Compression:
Stored size: 1.32 KB
Contents
require 'spec_helper' describe Toq::Request do subject { described_class.new } describe '#message' do it 'should be an accessor' do subject.message = 'test' subject.message.should == 'test' end end describe '#args' do it 'should be an accessor' do subject.args = %w(test) subject.args.should == %w(test) end end describe '#token' do it 'should be an accessor' do subject.token = 'blah' subject.token.should == 'blah' end end describe '#callback' do it 'should be an accessor' do called = false subject.callback = proc { called = true } subject.callback.call called.should be_true end end describe '#prepare_for_tx' do it 'should convert the request to a hash ready for transmission' do subject.prepare_for_tx.should be_empty described_class.new( message: 'obj.method', args: %w(test), token: 'mytoken', callback: proc{} ).prepare_for_tx.should =={ 'args' => %w(test), 'message' => 'obj.method', 'token' => 'mytoken' } end end end
Version data entries
6 entries across 6 versions & 1 rubygems