Sha256: 275aa175a439e64ec4cd0f6c595bc6444fbeff41dde4219ecd26508c0f3349b6
Contents?: true
Size: 957 Bytes
Versions: 74
Compression:
Stored size: 957 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/static_method_class' ::RSpec.describe ::EacRubyUtils::StaticMethodClass do let(:sender_class) do ::Class.new do class << self def sender_value 'AAA' end end end end let(:method_class) do the_described_class = described_class ::Class.new do def self.name 'TheSender::PerformX' end include the_described_class attr_accessor :sender, :method_param def initialize(sender, method_param) self.sender = sender self.method_param = method_param end def result "#{sender.sender_value},#{method_param}" end end end before do ::Object.const_set('TheSender', sender_class) sender_class.const_set('PerformX', method_class) end it { expect(sender_class).to respond_to(:perform_x) } it { expect(sender_class.perform_x('BBB')).to eq('AAA,BBB') } end
Version data entries
74 entries across 74 versions & 1 rubygems