Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Less metaprogramming in spec

  • Loading branch information...
commit 1075d8e437d32e8dd0175020aebbb182179a4055 1 parent f0cf29e
Andriy Yanko ayanko authored
Showing with 29 additions and 16 deletions.
  1. +29 −16 spec/middleware_spec.rb
45 spec/middleware_spec.rb
View
@@ -97,33 +97,46 @@
So I can write faster tests
) do
+ context ":rack_test driver", :driver => :rack_test do
+ context "rack application" do
+ background { Capybara.app = TestRackApp }
+ include_examples "common scenarios"
+ include_examples "rack scenarios"
+ end
+
+ context "sinatra application" do
+ background { Capybara.app = TestSinatraApp }
+ include_examples "common scenarios"
+ include_examples "sinatra scenarios"
+ end
- [:rack_test, :selenium].each do |driver_name|
- context "with rack application and #{driver_name.inspect} driver", :driver => driver_name do
- background do
- Capybara.current_driver.should == driver_name
- Capybara.app = TestRackApp
- end
+ context "rails application" do
+ background { Capybara.app = TestRackApp }
+ include_examples "common scenarios"
+ include_examples "rails scenarios"
+ end
+ end
+
+
+
+ context ":selenium driver", :driver => :selenium do
+ context "rack application" do
+ background { Capybara.app = TestRackApp }
include_examples "common scenarios"
include_examples "rack scenarios"
end
- context "with sinatra application and #{driver_name.inspect} driver", :driver => driver_name do
- background do
- Capybara.current_driver.should == driver_name
- Capybara.app = TestSinatraApp
- end
+ context "sinatra application" do
+ background { Capybara.app = TestSinatraApp }
include_examples "common scenarios"
include_examples "sinatra scenarios"
end
- context "with rails application and #{driver_name.inspect} driver", :driver => driver_name do
- background do
- Capybara.current_driver.should == driver_name
- Capybara.app = TestRailsApp::Application
- end
+ context "rails application" do
+ background { Capybara.app = TestRackApp }
include_examples "common scenarios"
include_examples "rails scenarios"
end
end
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.