diff --git a/lib/convenient_service/common/plugins/has_instance_proxy/commands/create_instance_proxy_class.rb b/lib/convenient_service/common/plugins/has_instance_proxy/commands/create_instance_proxy_class.rb index ac9832dcf78..00a15e5ba5f 100644 --- a/lib/convenient_service/common/plugins/has_instance_proxy/commands/create_instance_proxy_class.rb +++ b/lib/convenient_service/common/plugins/has_instance_proxy/commands/create_instance_proxy_class.rb @@ -54,18 +54,23 @@ def call # # end # klass.class_exec(target_class) do |target_class| + ## + # @return [Class] + # define_singleton_method(:target_class) { target_class } ## + # @return [Boolean, nil] + # # @internal # TODO: Try `self.target_class == other.target_class if self < ::ConvenientService::Common::Plugins::HasInstanceProxy::Entities::InstanceProxy`. # define_singleton_method(:==) { |other| self.target_class == other.target_class if other.respond_to?(:target_class) } ## - # TODO: `inspect`. + # @return [String] # - # define_singleton_method(:inspect) { "#{target_class}InstanceProxy" } + define_singleton_method(:inspect) { "#{target_class}::InstanceProxy" } end klass diff --git a/spec/lib/convenient_service/common/plugins/has_instance_proxy/commands/create_instance_proxy_class_spec.rb b/spec/lib/convenient_service/common/plugins/has_instance_proxy/commands/create_instance_proxy_class_spec.rb index f2a5862741d..9e9b8e23547 100644 --- a/spec/lib/convenient_service/common/plugins/has_instance_proxy/commands/create_instance_proxy_class_spec.rb +++ b/spec/lib/convenient_service/common/plugins/has_instance_proxy/commands/create_instance_proxy_class_spec.rb @@ -65,9 +65,11 @@ end end - ## - # TODO: Specs for autogenerated `#inspect`. - # + describe "#inspect" do + it "returns inspect representation" do + expect(instance_proxy_class.inspect).to eq("#{target_class}::InstanceProxy") + end + end end end end