2011-02-11 08:44:58 -05:00
|
|
|
module Capybara
|
|
|
|
module Features
|
|
|
|
def self.included(base)
|
|
|
|
base.instance_eval do
|
|
|
|
alias :background :before
|
|
|
|
alias :scenario :it
|
2012-10-30 09:43:41 -04:00
|
|
|
alias :xscenario :xit
|
2012-10-03 18:49:44 -04:00
|
|
|
alias :given :let
|
|
|
|
alias :given! :let!
|
2011-02-11 08:44:58 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-12 06:38:48 -05:00
|
|
|
def self.feature(*args, &block)
|
2011-02-11 08:44:58 -05:00
|
|
|
options = if args.last.is_a?(Hash) then args.pop else {} end
|
|
|
|
options[:capybara_feature] = true
|
2012-09-07 14:17:38 -04:00
|
|
|
options[:type] = :feature
|
2011-03-13 09:31:04 -04:00
|
|
|
options[:caller] ||= caller
|
2011-02-11 08:44:58 -05:00
|
|
|
args.push(options)
|
|
|
|
|
|
|
|
describe(*args, &block)
|
|
|
|
end
|
|
|
|
|
|
|
|
RSpec.configuration.include Capybara::Features, :capybara_feature => true
|