Sha256: 3810d8a0c6d729f311c6b2eeb2f9d1be4bff97a936ae8414a001a82636312ed7

Contents?: true

Size: 1.26 KB

Versions: 12

Compression:

Stored size: 1.26 KB

Contents

if RSpec::Core::Version::STRING.to_f >= 3.0
  RSpec.shared_context "Capybara Features", :capybara_feature => true do
    instance_eval do
      alias background before
      alias given let
      alias given! let!
    end
  end

  RSpec.configure do |config|
    config.alias_example_group_to :feature, :capybara_feature => true, :type => :feature
    config.alias_example_to :scenario
    config.alias_example_to :xscenario, :skip => "Temporarily disabled with xscenario"
    # config.alias_example_to :fscenario, :focus => true
  end
else
  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)

    #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
end

Version data entries

12 entries across 12 versions & 4 rubygems

Version Path
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/capybara-2.4.4/lib/capybara/rspec/features.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/capybara-2.4.4/lib/capybara/rspec/features.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/capybara-2.4.4/lib/capybara/rspec/features.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/capybara-2.4.4/lib/capybara/rspec/features.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/capybara-2.4.4/lib/capybara/rspec/features.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/capybara-2.4.4/lib/capybara/rspec/features.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/capybara-2.4.4/lib/capybara/rspec/features.rb
capybara-2.4.4 lib/capybara/rspec/features.rb
capybara-2.4.3 lib/capybara/rspec/features.rb
capybara-2.4.2 lib/capybara/rspec/features.rb
capybara-2.4.1 lib/capybara/rspec/features.rb
capybara-2.4.0 lib/capybara/rspec/features.rb