Permalink
Browse files

Add tests for the pub and sub addr overide

  • Loading branch information...
1 parent 5fafe6d commit c2a98e952ebb8b8e39caa83cf8c2da2b2231045b @larubbio larubbio committed Feb 15, 2012
Showing with 34 additions and 0 deletions.
  1. +33 −0 tests/base/engine_tests.lua
  2. +1 −0 tests/data/config.lua
@@ -0,0 +1,33 @@
+require 'tir.engine'
+
+
+function fake_main()
+ print("TEST")
+end
+
+context("Tir", function()
+ context("engine", function()
+ test("start", function()
+ Tir.run = function() return true end
+ Tir.M2.connect = function() return true end
+
+ local config = {config_file = 'tests/data/config.lua', route = '/arc'}
+ Tir.start(config)
+
+ assert_equal('tcp://127.0.0.1:9990', config.sub_addr)
+ assert_equal('tcp://127.0.0.1:9989', config.pub_addr)
+ end)
+
+ test("start-overide", function()
+ Tir.run = function() return true end
+ Tir.M2.connect = function() return true end
+
+ local config = {config_file = 'tests/data/config.lua', route = '/arc', pub_addr = 'tcp://10.234.56.71:9990', sub_addr = 'tcp://10.234.56.71:9989'}
+ Tir.start(config)
+
+ assert_equal('tcp://10.234.56.71:9990', config.pub_addr)
+ assert_equal('tcp://10.234.56.71:9989', config.sub_addr)
+ end)
+ end)
+end)
+
View
@@ -0,0 +1 @@
+config_db = 'tests/data/config.sqlite'

0 comments on commit c2a98e9

Please sign in to comment.