Sha256: 447c468b768a7fb31d7412e4f1d2e9a5c54471dd379a4d35a3a4e10d777b86a9
Contents?: true
Size: 756 Bytes
Versions: 175
Compression:
Stored size: 756 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/abstract_methods' RSpec.describe(::EacRubyUtils::AbstractMethods) do let(:base_class) do the_module = described_class ::Class.new do include the_module abstract_methods :method1, :method2 end end let(:base_instance) { base_class.new } let(:sub_class) do ::Class.new(base_class) do def method1 'a result' end end end let(:sub_instance) { sub_class.new } it { expect { base_instance.method1 }.to raise_error(::NoMethodError) } it { expect { base_instance.method2 }.to raise_error(::NoMethodError) } it { expect(sub_instance.method1).to eq('a result') } it { expect { sub_instance.method2 }.to raise_error(::NoMethodError) } end
Version data entries
175 entries across 175 versions & 3 rubygems