Sha256: df479329a7d7bb813804b814bf7bbff222ea733841d2e429ac7571da8a3357be

Contents?: true

Size: 1.56 KB

Versions: 12

Compression:

Stored size: 1.56 KB

Contents

require 'spec_helper'

module RevealCK
  module Commands
    describe ServeUI do
      let :serve_ui do
        ServeUI.new
      end

      let :separator do
        '------------------------------------------------------------'
      end

      let :default_prefix do
        '[ reveal-ck ]'
      end

      let :problem_prefix do
        '[  problem  ]'
      end

      describe '#message' do
        it 'prints the message (preceeded by a prefix) to standard out' do
          expect(serve_ui).to receive(:puts).with("#{default_prefix} Hello")
          serve_ui.message('Hello')
        end
      end

      describe '#problem' do
        it 'prints several messages to standard out' do
          expect(serve_ui).to receive(:puts).with(problem_prefix.to_s)
          expect(serve_ui)
            .to receive(:puts)
            .with("#{problem_prefix} Compilation Problem")
          expect(serve_ui).to receive(:puts).with(problem_prefix.to_s)
          expect(serve_ui)
            .to receive(:puts)
            .with("#{problem_prefix} on line 12")
          expect(serve_ui).to receive(:puts).with(problem_prefix.to_s)
          serve_ui.problem('Compilation Problem', 'on line 12')
        end
      end

      describe '#blank' do
        it 'prints a blank line' do
          expect(serve_ui).to receive(:puts).with ''
          serve_ui.blank
        end
      end

      describe '#separator' do
        it 'prints a bunch of dashes' do
          expect(serve_ui)
            .to receive(:puts).with separator
          serve_ui.separator
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
reveal-ck-4.0.0 spec/lib/reveal-ck/commands/serve_ui_spec.rb
reveal-ck-3.9.2 spec/lib/reveal-ck/commands/serve_ui_spec.rb
reveal-ck-3.9.1 spec/lib/reveal-ck/commands/serve_ui_spec.rb
reveal-ck-3.9.0 spec/lib/reveal-ck/commands/serve_ui_spec.rb
reveal-ck-3.8.1 spec/lib/reveal-ck/commands/serve_ui_spec.rb
reveal-ck-3.8.0 spec/lib/reveal-ck/commands/serve_ui_spec.rb
reveal-ck-3.7.0 spec/lib/reveal-ck/commands/serve_ui_spec.rb
reveal-ck-3.6.0 spec/lib/reveal-ck/commands/serve_ui_spec.rb
reveal-ck-3.5.1 spec/lib/reveal-ck/commands/serve_ui_spec.rb
reveal-ck-3.5.0 spec/lib/reveal-ck/commands/serve_ui_spec.rb
reveal-ck-3.4.0 spec/lib/reveal-ck/commands/serve_ui_spec.rb
reveal-ck-3.3.1 spec/lib/reveal-ck/commands/serve_ui_spec.rb