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

Version Path
avm-tools-0.97.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.96.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.95.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.94.3 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.94.2 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.94.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
ehbrs-tools-0.20.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.94.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.93.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.92.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.91.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.90.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.89.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.88.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.87.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
ehbrs-tools-0.19.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
ehbrs-tools-0.18.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.87.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
ehbrs-tools-0.17.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.86.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb