Sha256: 1f696283b642f2b63a41d22bbdb01c5b1c423bb79a018e8c415099d082f3cd5c

Contents?: true

Size: 1.19 KB

Versions: 14

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true
##############################################################################
#                               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 = args.last.is_a?(Hash) ? args.pop : {}
  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

14 entries across 14 versions & 1 rubygems

Version Path
rspeckled-0.0.30 lib/rspeckled/plugins/features.rb
rspeckled-0.0.29 lib/rspeckled/plugins/features.rb
rspeckled-0.0.28 lib/rspeckled/plugins/features.rb
rspeckled-0.0.27 lib/rspeckled/plugins/features.rb
rspeckled-0.0.26 lib/rspeckled/plugins/features.rb
rspeckled-0.0.25 lib/rspeckled/plugins/features.rb
rspeckled-0.0.24 lib/rspeckled/plugins/features.rb
rspeckled-0.0.23 lib/rspeckled/plugins/features.rb
rspeckled-0.0.22 lib/rspeckled/plugins/features.rb
rspeckled-0.0.21 lib/rspeckled/plugins/features.rb
rspeckled-0.0.20 lib/rspeckled/plugins/features.rb
rspeckled-0.0.19 lib/rspeckled/plugins/features.rb
rspeckled-0.0.18 lib/rspeckled/plugins/features.rb
rspeckled-0.0.17 lib/rspeckled/plugins/features.rb