test/all.rb in syro-0.0.6 vs test/all.rb in syro-0.0.7

- old
+ new

@@ -1,5 +1,11 @@ +class RackApp + def call(env) + [200, {"Content-Type" => "text/html"}, ["GET /rack"]] + end +end + class TextualDeck < Syro::Deck def text(str) res[Rack::CONTENT_TYPE] = "text/plain" res.write(str) end @@ -88,10 +94,14 @@ on("platforms") { run(platforms, id: 42) } + on("rack") { + run(RackApp.new) + } + on("users") { on(:id) { res.write(sprintf("GET /users/%s", inbox[:id])) } } @@ -168,9 +178,15 @@ end test "mounted app + inbox" do |f| f.get("/platforms") assert_equal "GET /platforms/42", f.last_response.body + assert_equal 200, f.last_response.status +end + +test "run rack app" do |f| + f.get("/rack") + assert_equal "GET /rack", f.last_response.body assert_equal 200, f.last_response.status end test "root" do |f| f.get("/")