Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 33 lines (26 sloc) 0.785 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
require 'rubygems'
require 'rspec'

class Rspec::Core::ExampleGroup
  class << self
    alias scenario example
    alias background before
  end
end

module Rspec::Core::KernelExtensions
  alias feature describe
end

if defined?(Rspec::Rails)

  module Rspec::Rails::Example
    module AcceptanceExampleGroup
      def method_missing(sym, *args, &block)
        return Rspec::Matchers::Be.new(sym, *args) if sym.to_s =~ /^be_/
        return Rspec::Matchers::Has.new(sym, *args) if sym.to_s =~ /^have_/
        super
      end
      
      Rspec.configure do |c|
        c.include RequestExampleGroupBehaviour, :example_group => { :file_path => /\bspec\/acceptance\// }
        c.include self, :example_group => { :file_path => /\bspec\/acceptance\// }
      end
    end
  end
  
end
Something went wrong with that request. Please try again.