Sha256: 2b25405bb4fd57785d98ca1865fefd6ae30fa48618880e60c5d1ff08cf7a71da

Contents?: true

Size: 525 Bytes

Versions: 5

Compression:

Stored size: 525 Bytes

Contents

require 'spec_helper'

describe Anima::Attribute, '#define_reader' do
  let(:object) { described_class.new(:foo) }

  subject { object.define_reader(target_class) }

  let(:target_class) do
    Class.new do
      def initialize(foo)
        @foo = foo
      end
    end
  end

  let(:value) { mock('Value') }

  it 'should create a reader' do
    instance = target_class.new(value)
    lambda { subject }.should change { instance.respond_to?(:foo) }.from(false).to(true)
  end

  it_should_behave_like 'a command method'
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
anima-0.0.6 spec/unit/anima/attribute/define_reader_spec.rb
anima-0.0.5 spec/unit/anima/attribute/define_reader_spec.rb
anima-0.0.4 spec/unit/anima/attribute/define_reader_spec.rb
anima-0.0.3 spec/unit/anima/attribute/define_reader_spec.rb
anima-0.0.2 spec/unit/anima/attribute/define_reader_spec.rb