Sha256: d8cd3c1f4977a79c37f7a80472e0af81d019e0f205c88627bcbdb83227fdc798

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'

describe Guard::Haml::Notifier do
  subject { described_class }

  describe '#image' do
    context 'when recieves true' do
      specify { subject.image(true).should be :success }
    end

    context 'when recieves false' do
      specify { subject.image(false).should be :failed }
    end
  end

  describe '#notify' do
    context 'when recieves true with message' do
      it 'should call Guard::Notifier with success image' do
        ::Guard::Notifier.should_receive(:notify).with(
            'Successful compilation!',
            :title => 'Guard::Haml',
            :image => :success
            )
        subject.notify(true, 'Successful compilation!')
      end
    end

    context 'when recieves false with message' do
      it 'should call Guard::Notifier with failed image' do
        ::Guard::Notifier.should_receive(:notify).with(
                'Compilation failed!',
                :title => 'Guard::Haml',
                :image => :failed
                )
        subject.notify(false, 'Compilation failed!')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
guard-haml-0.5 spec/guard/haml/notifier_spec.rb
guard-haml-ext-0.6 spec/guard/haml/notifier_spec.rb