<commit_before><commit_msg>added spec for runner<commit_after>require 'spec_helper'

describe Guard::Tap::Runner do

  let(:runner) { Guard::Tap::Runner }

  before do
    runner.stub(:notify)
  end

  describe '#run' do
    it 'returns true when success' do
      runner.run('pwd').should == true
    end

    it 'returns false when failed' do
      runner.run('undefined_method').should == false
    end
  end

  describe '#notify' do
    before do
      runner.unstub(:notify)
    end

    it 'calls UI and Notifier' do
      Guard::UI.should_receive(:info).with('hi')
      Guard::Notifier.should_receive(:notify).with('hi', foo: 'bar')
      runner.notify 'hi', foo: 'bar'
    end
  end

  describe '#notify_success' do
    it 'calls notify with image: success' do
      runner.should_receive(:notify).with('hi', image: :success)
      runner.notify_success('hi')
    end
  end

  describe '#notify_error' do
    it 'calls notify with image: failed' do
      runner.should_receive(:notify).with('hi', image: :failed)
      runner.notify_error('hi')
    end
  end

end
{'fraction_non_alphanumeric': 0.12686567164179105, 'fraction_numerical': 0.0, 'mean_word_length': 3.1750972762645913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3491238', 'n_tokens_mistral': 344, 'n_tokens_neox': 335, 'n_words': 92}