Sha256: fcc7eafecbaf9982c113e565499eb361fec636341662cc8a50d28d41e37a16ab

Contents?: true

Size: 1.27 KB

Versions: 15

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'

describe MotherBrain do
  subject { MotherBrain }

  describe "::app_root" do
    it "returns a pathname" do
      subject.app_root.should be_a(Pathname)
    end
  end

  describe "::scripts" do
    it "returns a pathname" do
      subject.scripts.should be_a(Pathname)
    end
  end

  describe "::logger" do
    it "delegates to MB::Logging.logger" do
      MB::Logging.should_receive(:logger)

      subject.logger
    end
  end

  describe "::set_logger" do
    it "delegates to MB::Logging.set_logger" do
      new_logger = Logger.new('/dev/null')
      MB::Logging.should_receive(:set_logger).with(new_logger)

      subject.set_logger(new_logger)
    end
  end

  describe "::expand_procs" do
    it "returns an array of arrays containing the result of the evaluated procs" do
      procs = [
        -> { :one },
        -> { :two },
        [
          -> { :nested },
          [
            -> { :deep_nested }
          ]
        ]
      ]
      result = subject.expand_procs(procs)

      result.should have(3).items
      result[0].should eql(:one)
      result[1].should eql(:two)
      result[2].should have(2).items
      result[2][0].should eql(:nested)
      result[2][1].should have(1).item
      result[2][1][0].should eql(:deep_nested)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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