Sha256: 9a20374ba78a67808a110c30351783d40aa781a36fe3e0a5710a5b632684c42a

Contents?: true

Size: 695 Bytes

Versions: 2

Compression:

Stored size: 695 Bytes

Contents

module PageMagic
  describe ClassMethods do
    subject do
      Object.new.tap { |o| o.extend(described_class) }
    end
    describe '#url' do
      it 'get/sets a value' do
        subject.url(:url)
        expect(subject.url).to eq(:url)
      end
    end

    describe 'on_load' do
      context 'block not set' do
        it 'returns a default block' do
          expect(subject.on_load).to be(described_class::DEFAULT_ON_LOAD)
        end
      end

      context 'block set' do
        it 'returns that block' do
          expected_block = proc {}
          subject.on_load(&expected_block)
          expect(subject.on_load).to be(expected_block)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
page_magic-1.0.0.alpha20 spec/page_magic/class_methods_spec.rb
page_magic-1.0.0.alpha19 spec/page_magic/class_methods_spec.rb