Sha256: e03c6ce3f20f79688f5810b54cf4365d5635f8ca3ea1187eaad3bc2bf3de36bb

Contents?: true

Size: 1.16 KB

Versions: 9

Compression:

Stored size: 1.16 KB

Contents

class LoadedClass
  extend RSpec::Support::RubyFeatures

  M = :m
  N = :n
  INSTANCE = LoadedClass.new

  class << self

    def respond_to?(method_name, include_all = false)
      return true if method_name == :dynamic_class_method
      super
    end

    def defined_class_method
    end

    def send
      # fake out!
    end

  protected

    def defined_protected_class_method
    end

  private

    def defined_private_class_method
    end

  end

  def defined_instance_method
  end

  def instance_method_with_two_args(a, b)
  end

  def instance_method_with_only_defaults(a=1, b=2)
  end

  if required_kw_args_supported?
    # Need to eval this since it is invalid syntax on earlier rubies.
    eval <<-RUBY
      def kw_args_method(foo, optional_arg:'hello', required_arg:)
      end

      def mixed_args_method(foo, bar, optional_arg_1:1, optional_arg_2:2)
      end
    RUBY
  end

  def send(*)
  end

  def respond_to?(method_name, include_all = false)
    return true if method_name == :dynamic_instance_method
    super
  end

  class Nested; end

protected

  def defined_protected_method
  end

private

  def defined_private_method
    "wink wink ;)"
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
opal-rspec-0.6.2 rspec-mocks/spec/support/doubled_classes.rb
opal-rspec-0.6.1 rspec-mocks/spec/support/doubled_classes.rb
opal-rspec-0.6.0 rspec-mocks/spec/support/doubled_classes.rb
opal-rspec-0.6.0.beta1 rspec-mocks/spec/support/doubled_classes.rb
opal-connect-rspec-0.5.0 rspec-mocks/spec/support/doubled_classes.rb
opal-rspec-0.5.0 rspec-mocks/spec/support/doubled_classes.rb
opal-rspec-0.5.0.beta3 rspec-mocks/spec/support/doubled_classes.rb
opal-rspec-0.5.0.beta2 rspec-mocks/spec/support/doubled_classes.rb
opal-rspec-0.5.0.beta1 rspec-mocks/spec/support/doubled_classes.rb