Sha256: a793d4b294969c852cc99d2ea6521ab17cfca301c7abcfa047eead96dc42700e

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

##############################################################################
#                               Features Plugin
##############################################################################
#
# This plugin enables the feature/scenario/background/given syntax in RSpec
# without requiring Capybara as a dependency (and may also be used outside of
# Rails).  The contents of this file are taken verbatim from
#
# https://github.com/jnicklas/capybara/blob/cd4327857bd3bafa8614b7bffb2886a8ab401953/lib/capybara/rspec/features.rb
#
# and should be updated whenever that file is updated.
#
module Capybara
  module Features
    def self.included(base)
      base.instance_eval do
        alias :background :before
        alias :scenario :it
        alias :xscenario :xit
        alias :given :let
        alias :given! :let!
        alias :feature :describe
      end
    end
  end
end


def self.feature(*args, &block)
  options = if args.last.is_a?(Hash) then args.pop else {} end
  options[:capybara_feature] = true
  options[:type] = :feature
  options[:caller] ||= caller
  args.push(options)

  describe(*args, &block)
end

RSpec.configuration.include Capybara::Features, :capybara_feature => true

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspectacular-0.14.1 lib/rspectacular/plugins/features.rb