Flowdock
method

convert_constraint

Importance_0
RSpec latest stable (1.3.1) - 0 notes - Class: Spec::Mocks::ArgumentExpectation

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (1.1.4) is shown here.

convert_constraint(constraint) public

No documentation

This method has no description. You can help the RSpec community by adding new notes.

Hide source
# File lib/spec/mocks/argument_expectation.rb, line 170
      def convert_constraint(constraint)
        if [:anything, :numeric, :boolean, :string].include?(constraint)
          case constraint
          when :anything
            instead = "anything()"
          when :boolean
            instead = "boolean()"
          when :numeric
            instead = "an_instance_of(Numeric)"
          when :string
            instead = "an_instance_of(String)"
          end
          warn_deprecated(constraint.inspect, instead)
          return @@constraint_classes[constraint].new(constraint)
        end
        return MatcherConstraint.new(constraint) if is_matcher?(constraint)
        return RegexpArgConstraint.new(constraint) if constraint.is_a?(Regexp)
        return LiteralArgConstraint.new(constraint)
      end
Register or log in to add new notes.