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.85.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.85.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
ehbrs-tools-0.16.5 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.84.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.83.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
ehbrs-tools-0.16.4 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.82.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.82.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.81.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
ehbrs-tools-0.16.3 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.80.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.79.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.78.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
ehbrs-tools-0.16.2 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
avm-tools-0.77.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb