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
eac_tools-0.63.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.62.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.62.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.61.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.61.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.60.3 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.60.2 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.60.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.60.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.59.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.58.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.57.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.56.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.56.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.55.7 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.55.6 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.55.5 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.55.4 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.55.3 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.55.2 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb