Sha256: 3e7898bcea7ceb3cf28c1729bf7b7fbbefef5db131f79f127330e232fb51ece7

Contents?: true

Size: 696 Bytes

Versions: 15

Compression:

Stored size: 696 Bytes

Contents

require 'spec_helper'

describe MB::ConfigManager do
  subject { described_class.new(@config) }

  describe "update" do
    let(:listener) do
      Class.new do
        include Celluloid
        include Celluloid::Notifications
      end.new
    end

    let(:new_config) do
      double('config', validate!: true)
    end

    it "sends the 'config_manager.configure' notification" do
      listener.subscribe('config_manager.configure', :trigger)
      listener.should_receive(:trigger).once

      subject.update(new_config)
    end

    it "updates the config attribute with the given config" do
      subject.update(new_config)

      subject.config.should eql(new_config)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
motherbrain-1.5.0 spec/unit/mb/config_manager_spec.rb
motherbrain-1.4.0 spec/unit/mb/config_manager_spec.rb
motherbrain-1.3.0 spec/unit/mb/config_manager_spec.rb
motherbrain-1.2.1 spec/unit/mb/config_manager_spec.rb
motherbrain-1.2.0 spec/unit/mb/config_manager_spec.rb
motherbrain-1.1.3 spec/unit/mb/config_manager_spec.rb
motherbrain-1.1.2 spec/unit/mb/config_manager_spec.rb
motherbrain-1.1.1 spec/unit/mb/config_manager_spec.rb
motherbrain-1.1.0 spec/unit/mb/config_manager_spec.rb
motherbrain-1.0.0 spec/unit/mb/config_manager_spec.rb
motherbrain-0.14.5 spec/unit/mb/config_manager_spec.rb
motherbrain-0.14.4 spec/unit/mb/config_manager_spec.rb
motherbrain-0.14.3 spec/unit/mb/config_manager_spec.rb
motherbrain-0.14.2 spec/unit/mb/config_manager_spec.rb
motherbrain-0.13.1 spec/unit/mb/config_manager_spec.rb