Pass `feature` caller to `describe`

This commit is contained in:
Luismi Cavalle 2011-03-13 14:31:04 +01:00
parent 6f2e8c547b
commit d5b5847334
2 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,7 @@ def feature(*args, &block)
options = if args.last.is_a?(Hash) then args.pop else {} end
options[:capybara_feature] = true
options[:type] = :request
options[:caller] ||= caller
args.push(options)
describe(*args, &block)

View File

@ -3,6 +3,10 @@ require 'capybara/rspec'
Capybara.app = TestApp
RSpec.configuration.before(:each, :example_group => {:file_path => __FILE__}) do
@in_filtered_hook = true
end
feature "Capybara's feature DSL" do
background do
@in_background = true
@ -24,6 +28,10 @@ feature "Capybara's feature DSL" do
scenario "runs background" do
@in_background.should be_true
end
scenario "runs hooks filtered by file path" do
@in_filtered_hook.should be_true
end
end
feature "Capybara's feature DSL with driver", :driver => :culerity do