Sha256: 306bf600ccd7617cb032f8ad01d18756b806114c1eeaeeab52b9288b05f07ae8

Contents?: true

Size: 590 Bytes

Versions: 7

Compression:

Stored size: 590 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Azeroth::Decorator::MethodBuilder do
  let(:decorator_class) { Class.new(Azeroth::Decorator) }
  let(:decorator)       { decorator_class.new(object) }
  let(:model)           { build(:dummy_model) }
  let(:object)          { model }

  describe '.build_reader' do
    it do
      expect { described_class.build_reader(decorator_class, :age) }
        .to add_method(:age).to(decorator)
    end

    it do
      described_class.build_reader(decorator_class, :age)

      expect(decorator.age).to eq(model.age)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
azeroth-1.0.0 spec/lib/azeroth/decorator/method_builder_spec.rb
azeroth-0.10.1 spec/lib/azeroth/decorator/method_builder_spec.rb
azeroth-0.10.0 spec/lib/azeroth/decorator/method_builder_spec.rb
azeroth-0.9.0 spec/lib/azeroth/decorator/method_builder_spec.rb
azeroth-0.8.2 spec/lib/azeroth/decorator/method_builder_spec.rb
azeroth-0.8.1 spec/lib/azeroth/decorator/method_builder_spec.rb
azeroth-0.8.0 spec/lib/azeroth/decorator/method_builder_spec.rb