Class: TestInsteon_2412N_Marshaller

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/belphanior/servant/homenetwork/test/tc_insteon_2412n_marshaller.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



8
9
10
11
12
13
14
# File 'lib/belphanior/servant/homenetwork/test/tc_insteon_2412n_marshaller.rb', line 8

def setup
  @netmock = mock('Net::HTTP')
  @requestmock = mock()
  @marshaller =
    Belphanior::Servant::HomeNetwork::Insteon_2412n_Marshaller.new(
    'localhost', @netmock)
end

#test_sendObject



15
16
17
18
19
20
# File 'lib/belphanior/servant/homenetwork/test/tc_insteon_2412n_marshaller.rb', line 15

def test_send
  input = "02636600"
  @netmock.expects(:start).with('localhost',80).yields(@requestmock)
  @requestmock.expects(:post).with("/3?"+input+"=I=3","")
  @marshaller.send(input)
end