Sha256: 76d04e7a3e4a9f73ab05a303f1f697d0ff4bad8454293f1a5cb8030df5a5522d

Contents?: true

Size: 1.12 KB

Versions: 11

Compression:

Stored size: 1.12 KB

Contents

# require 'test_helper'
# require 'uber/inheritable_included'

# module InheritIncludedTo
#   def self.call(includer, proc)
#     proc.call(includer) # das will ich eigentlich machen

#     includer.class_eval do
#       @block = proc

#       def self.included(base) #
#         InheritIncludedTo.call(base, instance_variable_get(:@block))
#       end
#     end
#   end
# end

# class InheritanceTest < MiniTest::Spec
#   module Feature
#     #extend Uber::InheritedIncluded

#     CODE_BLOCK = lambda { |base| base.class_eval { extend ClassMethods } } # i want that to be executed at every include


#     def self.included(includer) #
#       # CODE_BLOCK.call(base)
#       InheritIncludedTo.call(includer, CODE_BLOCK)
#     end

#     module ClassMethods
#       def feature; end
#     end
#   end

#   module Extension
#     include Feature

#     # TODO: test overriding ::included
#   end

#   module Client
#     include Extension
#   end

#   module ExtendedClient
#     include Client
#   end

#   it { Extension.must_respond_to :feature }
#   it { Client.must_respond_to :feature }
#   it { ExtendedClient.must_respond_to :feature }
# end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/uber-0.1.0/test/inheritance_test.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/uber-0.1.0/test/inheritance_test.rb
uber-0.1.0 test/inheritance_test.rb
uber-0.0.15 test/inheritance_test.rb
uber-0.0.14 test/inheritance_test.rb
uber-0.0.13 test/inheritance_test.rb
uber-0.0.12 test/inheritance_test.rb
uber-0.0.11 test/inheritance_test.rb
uber-0.0.10 test/inheritance_test.rb
uber-0.0.9 test/inheritance_test.rb
uber-0.0.8 test/inheritance_test.rb