Sha256: bab939a6c8a91b0e50835572e569ce2e03f178e51ad2f725a84c4e641c00ba9f
Contents?: true
Size: 1.06 KB
Versions: 10
Compression:
Stored size: 1.06 KB
Contents
class TestNephosServerController < Test::Unit::TestCase def test_initialize_success assert Nephos::Controller.new() assert Nephos::Controller.new(env={}, {path: [], args: {}}, {params: []}) end def test_initialize_failure assert_raise do Nephos::Controller.new({}, {}, {}) end assert_raise do Nephos::Controller.new({}, {path: nil}, {}) end assert_raise do Nephos::Controller.new({}, {path: []}, {}) end assert_raise do Nephos::Controller.new({}, {path: [], args: {}}, {}) end assert_raise do Nephos::Controller.new({}, {path: [], args: {}}, {params: nil}) end assert_raise do Nephos::Controller.new({}, {path: nil, args: nil}, params: nil) end assert_raise do Nephos::Controller.new({}, {path: nil, args: {}}, {params: {}}) end assert_raise do Nephos::Controller.new({}, {path: [], args: nil}, {params: {}}) end end def test_controller_params c = Nephos::Controller.new(env={}, {path: ["value"], args: {}}, {params: ["param"]}) assert_equal "value", c.params[:param] assert_equal "value", c.params["param"] end end
Version data entries
10 entries across 10 versions & 1 rubygems