Sha256: 56c3ef462d39f5f60fd4418063b0649360ac8d0496b685f32dd0c0ba803df8a6

Contents?: true

Size: 631 Bytes

Versions: 7

Compression:

Stored size: 631 Bytes

Contents

require 'spec_helper'

class Danica::Expressable::Dummy
  include Danica::Expressable

  built_with :the_block
end

describe Danica::Expressable do
  let(:clazz) { described_class::Dummy }

  describe '.build' do
    it 'responds to build' do
      expect(clazz).to respond_to(:build)
    end

    it 'returns a child class object' do
      expect(clazz.build(:x) do
        x
      end.superclass).to be(clazz)
    end
  end

  describe '.create' do
    it 'responds to create' do
      expect(clazz).to respond_to(:create)
    end

    it do
      expect(clazz.create(:x) do
        x
      end).to be_a(clazz)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
danica-2.6.4 spec/lib/danica/expressable_spec.rb
danica-2.6.3 spec/lib/danica/expressable_spec.rb
danica-2.6.2 spec/lib/danica/expressable_spec.rb
danica-2.6.1 spec/lib/danica/expressable_spec.rb
danica-2.6.0 spec/lib/danica/expressable_spec.rb
danica-2.5.1 spec/lib/danica/expressable_spec.rb
danica-2.5.0 spec/lib/danica/expressable_spec.rb