Sha256: 26e456bac2d15c1b1216cda948b2a2c0ba36b06aa4942e1e3193f029f5978682

Contents?: true

Size: 1.26 KB

Versions: 20

Compression:

Stored size: 1.26 KB

Contents

require 'test_helper'

module Vedeu

  describe 'Bindings' do
    it { Vedeu.bound?(:_log_).must_equal(true) }
  end

  module Logging

    describe Log do

      let(:described) { Vedeu::Logging::Log }
      let(:_message)  { 'Some message...' }
      let(:force)     { false }
      let(:type)      { :info }

      describe '.log' do
        subject { described.log(message: _message, force: force, type: type) }

        it { subject.must_equal(
          "\e[97m[info]   \e[39m\e[39mSome message...\e[39m"
        ) }
      end

      describe '.log_stdout' do
        let(:type)     { :create }
        let(:_message) { 'Logging to stdout...' }

        subject { described.log_stdout(type: type, message: _message) }

        it {
          capture_io { subject }.must_equal(
            ["\e[96m[create] \e[39m\e[36mLogging to stdout...\e[39m\n", ""]
          )
        }
      end

      describe '.log_stdout' do
        let(:type)     { :debug }
        let(:_message) { 'Logging to stderr...' }

        subject { described.log_stderr(type: type, message: _message) }

        it {
          capture_io { subject }.must_equal(
            ["", "\e[97m[debug]  \e[39m\e[39mLogging to stderr...\e[39m\n"]
          )
        }
      end

    end # Log

  end # Logging

end # Vedeu

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
vedeu-0.6.49 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.48 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.47 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.46 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.45 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.44 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.43 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.42 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.41 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.40 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.39 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.38 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.37 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.36 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.35 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.34 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.33 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.32 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.31 test/lib/vedeu/logging/log_test.rb
vedeu-0.6.30 test/lib/vedeu/logging/log_test.rb