Class: DeepTest::RSpecDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/deep_test/rspec_detector.rb

Class Method Summary collapse

Class Method Details

.if_rspec_availableObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/deep_test/rspec_detector.rb', line 3

def self.if_rspec_available
  require "rubygems"
  # requiring 'spec' directly blows up unit-record
  require "spec/version" 
  if defined?(::Spec)
    if ::Spec::VERSION::MAJOR == 1 &&
       ::Spec::VERSION::MINOR == 1 &&
       ::Spec::VERSION::TINY  == 8
      yield
    else
      require 'spec/rake/spectask'
      ::Spec::Rake::SpecTask.class_eval do
        def deep_test(options)
          raise "* DeepTest RSpec support requires RSpec 1.1.8"
        end
      end
    end
  end
rescue LoadError, Gem::LoadError
end