File: object.rb

package info (click to toggle)
ruby-rspec-expectations 2.14.2-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 920 kB
  • sloc: ruby: 8,202; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 727 bytes parent folder | download | duplicates (2)
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
module RSpec
  module Expectations
    module DeprecatedConstants
      # Displays deprecation warning when it captures Rspec and Spec. Otherwise
      # delegates to super.
      def const_missing(name)
        case name
        when :Rspec, :Spec
          RSpec.deprecate(name.to_s, :replacement => "RSpec")
          RSpec
        else
          begin
            super
          rescue Exception => e
            e.backtrace.reject! {|l| l =~ Regexp.compile(__FILE__) }
            raise e
          end
        end
      end
    end

    # @deprecated (no replacement)
    def differ=(ignore)
      RSpec.deprecate("RSpec::Expectations.differ=(differ)")
    end
  end
end

extend RSpec::Expectations::DeprecatedConstants