Sha256: 8ee2df62aeb59c491f7728c39b635536bab8f3513c458d4942a7292fc20d46f8

Contents?: true

Size: 1.22 KB

Versions: 10

Compression:

Stored size: 1.22 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_method :background, :before
        alias_method :scenario, :it
        alias_method :xscenario, :xit
        alias_method :given, :let
        alias_method :given!, :let!
        alias_method :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

10 entries across 10 versions & 2 rubygems

Version Path
rspectacular-0.70.8 lib/rspectacular/plugins/features.rb
rspeckled-0.0.7 lib/rspeckled/plugins/features.rb
rspeckled-0.0.6 lib/rspeckled/plugins/features.rb
rspeckled-0.0.5 lib/rspeckled/plugins/features.rb
rspeckled-0.0.4 lib/rspeckled/plugins/features.rb
rspectacular-0.70.7 lib/rspectacular/plugins/features.rb
rspeckled-0.0.3 lib/rspeckled/plugins/features.rb
rspeckled-0.0.2 lib/rspeckled/plugins/features.rb
rspeckled-0.0.1 lib/rspeckled/plugins/features.rb
rspectacular-0.70.6 lib/rspectacular/plugins/features.rb