Sha256: ce5b20dc64dbadefadf9a8c503408661e0bc3ef1e5018c33a311f317e479a061

Contents?: true

Size: 1.16 KB

Versions: 9

Compression:

Stored size: 1.16 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 = 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

9 entries across 9 versions & 1 rubygems

Version Path
rspeckled-0.0.16 lib/rspeckled/plugins/features.rb
rspeckled-0.0.15 lib/rspeckled/plugins/features.rb
rspeckled-0.0.14 lib/rspeckled/plugins/features.rb
rspeckled-0.0.13 lib/rspeckled/plugins/features.rb
rspeckled-0.0.12 lib/rspeckled/plugins/features.rb
rspeckled-0.0.11 lib/rspeckled/plugins/features.rb
rspeckled-0.0.10 lib/rspeckled/plugins/features.rb
rspeckled-0.0.9 lib/rspeckled/plugins/features.rb
rspeckled-0.0.8 lib/rspeckled/plugins/features.rb