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.27.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.26.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.25.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.25.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.24.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.24.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.23.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.22.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.21.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.20.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.19.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.18.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.17.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.16.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.16.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.15.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.14.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.13.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.12.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb
eac_tools-0.11.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb