1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
teamcapybara--capybara/lib/capybara/rspec/features.rb

29 lines
697 B
Ruby
Raw Normal View History

module Capybara
module Features
def self.included(base)
base.instance_eval do
alias :background :before
alias :scenario :it
alias :xscenario :xit
2012-10-03 18:49:44 -04:00
alias :given :let
alias :given! :let!
2013-07-09 18:58:18 -04:00
alias :feature :describe
end
end
end
end
2013-07-09 18:58:18 -04:00
def self.feature(*args, &block)
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
args.push(options)
#call describe on RSpec in case user has expose_dsl_globally set to false
RSpec.describe(*args, &block)
end
RSpec.configuration.include Capybara::Features, :capybara_feature => true