Sha256: fec6d1d296af017210a3c2dc817979eb6e7647246c0e380be39e8652c79c6191

Contents?: true

Size: 541 Bytes

Versions: 11

Compression:

Stored size: 541 Bytes

Contents

module Copyable
  module DeclarationStubber

    # This creates dummy methods for each declaration, which is useful
    # if you are creating a class that merely wants to check that
    # a particular declaration is called correctly.  It's useful to
    # have the other declarations that you don't care about available
    # as stubs.
    def self.included(klass)
      Declarations::ALL.each do |decl|
        klass.send(:define_method, decl.method_name) do |*args|
          # intentionally empty
        end
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
copyable-0.3.5 lib/copyable/syntax_checking/declaration_stubber.rb
copyable-0.3.3 lib/copyable/syntax_checking/declaration_stubber.rb
copyable-0.3.2 lib/copyable/syntax_checking/declaration_stubber.rb
copyable-0.3.1 lib/copyable/syntax_checking/declaration_stubber.rb
copyable-0.3.0 lib/copyable/syntax_checking/declaration_stubber.rb
copyable-0.2.0 lib/copyable/syntax_checking/declaration_stubber.rb
copyable-0.1.2 lib/copyable/syntax_checking/declaration_stubber.rb
copyable-0.1.1 lib/copyable/syntax_checking/declaration_stubber.rb
copyable-0.1.0 lib/copyable/syntax_checking/declaration_stubber.rb
copyable-0.0.2 lib/copyable/syntax_checking/declaration_stubber.rb
copyable-0.0.1 lib/copyable/syntax_checking/declaration_stubber.rb