From 073a8dee74890abb60dd57c1a87cf67a0356439d Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Wed, 30 Nov 2011 10:17:23 -0800 Subject: [PATCH] add test for simple sinatra/rack app mounting --- features/mount_rack.feature | 8 ++++++++ fixtures/sinatra-app/config.rb | 11 +++++++++++ fixtures/sinatra-app/source/index.html.erb | 5 +++++ middleman.gemspec | 1 + 4 files changed, 25 insertions(+) create mode 100644 features/mount_rack.feature create mode 100644 fixtures/sinatra-app/config.rb create mode 100644 fixtures/sinatra-app/source/index.html.erb diff --git a/features/mount_rack.feature b/features/mount_rack.feature new file mode 100644 index 00000000..8e88b164 --- /dev/null +++ b/features/mount_rack.feature @@ -0,0 +1,8 @@ +Feature: Support Rack apps mounted using map + + Scenario: Mounted Rack App at /sinatra + Given the Server is running at "sinatra-app" + When I go to "/" + Then I should see "Hello World (Middleman)" + When I go to "/sinatra/" + Then I should see "Hello World (Sinatra)" \ No newline at end of file diff --git a/fixtures/sinatra-app/config.rb b/fixtures/sinatra-app/config.rb new file mode 100644 index 00000000..1642da57 --- /dev/null +++ b/fixtures/sinatra-app/config.rb @@ -0,0 +1,11 @@ +require "sinatra" + +class MySinatra < Sinatra::Base + get "/" do + "Hello World (Sinatra)" + end +end + +map "/sinatra" do + run MySinatra +end \ No newline at end of file diff --git a/fixtures/sinatra-app/source/index.html.erb b/fixtures/sinatra-app/source/index.html.erb new file mode 100644 index 00000000..8b59c41c --- /dev/null +++ b/fixtures/sinatra-app/source/index.html.erb @@ -0,0 +1,5 @@ +--- +layout: false +--- + +Hello World (Middleman) \ No newline at end of file diff --git a/middleman.gemspec b/middleman.gemspec index 11393305..c74ed50f 100644 --- a/middleman.gemspec +++ b/middleman.gemspec @@ -43,6 +43,7 @@ Gem::Specification.new do |s| # Development and test s.add_development_dependency("slim") s.add_development_dependency("rdiscount") + s.add_development_dependency("sinatra") s.add_development_dependency("coffee-filter", ["~> 0.1.1"]) s.add_development_dependency("liquid", ["~> 2.2.0"]) s.add_development_dependency("cucumber", ["~> 1.1.0"])