Sha256: 8dfd662e4079e15d0bed5cf4983e9e4433917f8305b72591231bf4f254ab8773

Contents?: true

Size: 570 Bytes

Versions: 6

Compression:

Stored size: 570 Bytes

Contents

require 'spec_helper'

describe Isomer do
  describe '.configure' do
    before do
      Isomer::Base.stub(:from)
    end

    it 'yields the configuration to the class' do
      expect do |b|
        Isomer.configure(anything, {}, &b)
      end.to yield_control
    end

    it 'creates a new instance of the configuration class' do
      klass = double('Anonymous Class')
      Class.stub(:new).with(Isomer::Base).and_return(klass)

      klass.should_receive(:from).with(:foo, :bar).and_return(:baz)
      Isomer.configure(:foo, :bar).should == :baz
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
isomer-0.1.4 spec/isomer_spec.rb
isomer-0.1.3 spec/isomer_spec.rb
isomer-0.1.2 spec/isomer_spec.rb
isomer-0.1.1 spec/isomer_spec.rb
isomer-0.1.0 spec/isomer_spec.rb
isomer-0.0.1 spec/isomer_spec.rb