Sha256: 40d3916bda65a9b33f330b08209663b3ff1e27abcb8a41aec1c3aaf10fd1592f

Contents?: true

Size: 782 Bytes

Versions: 56

Compression:

Stored size: 782 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/common_concern'

RSpec.describe ::EacRubyUtils::CommonConcern do
  let(:instance) do
    described_class.new do
      self.valor = 'changed'
    end
  end

  module MyModule
    module ClassMethods
      def my_class_method
        'class'
      end
    end

    module InstanceMethods
      def my_instance_method
        'instance'
      end
    end
  end

  class MyClass
    class << self
      attr_accessor :valor
    end
  end

  let(:subject) { MyClass.new }

  before do
    instance.setup(MyModule)
    MyClass.include MyModule
  end

  it { expect(subject.my_instance_method).to eq('instance') }
  it { expect(subject.class.my_class_method).to eq('class') }
  it { expect(subject.class.valor).to eq('changed') }
end

Version data entries

56 entries across 56 versions & 2 rubygems

Version Path
avm-tools-0.80.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.79.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.78.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
ehbrs-tools-0.16.2 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.77.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
ehbrs-tools-0.16.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.76.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
ehbrs-tools-0.16.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.76.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.75.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.75.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.74.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.74.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.73.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.72.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.71.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.70.2 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
ehbrs-tools-0.15.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
ehbrs-tools-0.14.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
avm-tools-0.70.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb