guard-compat 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e239e5c4419c41da77a177d350c96c06492aaca6
4
- data.tar.gz: e3913cafe922668c788278b72f59d00037cae4fb
3
+ metadata.gz: a5c15f5a243693a6af0123db855199c6dd3ce1a0
4
+ data.tar.gz: 2b4187ea85ba0bfa512d5298788c5c21f46a89cd
5
5
  SHA512:
6
- metadata.gz: 5e55139a5d038f3c4bf67af5ae3615ccaa273c466ca45f7ba372a09a217c37d5594583ca2baed30d13079849f819271386c39de69e4f79aa8825e735cf893024
7
- data.tar.gz: 949dc35946c588259b2b3eebe9d4b7f954b8b0fac40092e921cffd25df28fb16819c35e3d2ac6ca6d37b01e84caa1394d6282de841bebdc777c670471584b6c2
6
+ metadata.gz: d5c161fe3ef52a00aaca0a1c81ee30acda5febb69c642b9067ea8866ecfb4440f8d41da0ad5572fdd2ea2b7dde923b177dd6319b7c23b1a328d8db5f362806a3
7
+ data.tar.gz: 7706bfba6558b2abf1642afc25280f5cbb6af15c83f59af5b5bb5f29b7e19e9764e4d4634c1e9dfff11ecfaa0c8d12bb3a26d25f7def96a6c80ad5ff5b864165
@@ -4,12 +4,23 @@
4
4
  module Guard
5
5
  class MyPlugin < Plugin
6
6
  def start
7
- Guard::Notifier.notify('foo', title: 'bar')
7
+ Guard::Notifier.notify('foo')
8
+
8
9
  Guard::UI.info('foo')
9
10
  Guard::UI.warning('foo')
10
11
  Guard::UI.error('foo')
11
12
  Guard::UI.debug('foo')
12
13
  Guard::UI.deprecation('foo')
13
14
  end
15
+
16
+ def run_all
17
+ Guard::Notifier.notify('foo', title: 'bar')
18
+
19
+ Guard::UI.info('foo', bar: :baz)
20
+ Guard::UI.warning('foo', bar: :baz)
21
+ Guard::UI.error('foo', bar: :baz)
22
+ Guard::UI.debug('foo', bar: :baz)
23
+ Guard::UI.deprecation('foo', bar: :baz)
24
+ end
14
25
  end
15
26
  end
@@ -9,29 +9,29 @@ module Guard
9
9
  end
10
10
 
11
11
  class Notifier
12
- def self.notify(_msg, _options)
12
+ def self.notify(_msg, _options = {})
13
13
  fail NotImplementedError, 'stub this method in your tests'
14
14
  end
15
15
  end
16
16
 
17
17
  class UI
18
- def self.info(_msg)
18
+ def self.info(_msg, _options = {})
19
19
  fail NotImplementedError, 'stub this method in your tests'
20
20
  end
21
21
 
22
- def self.warning(_msg)
22
+ def self.warning(_msg, _options = {})
23
23
  fail NotImplementedError, 'stub this method in your tests'
24
24
  end
25
25
 
26
- def self.error(_msg)
26
+ def self.error(_msg, _options = {})
27
27
  fail NotImplementedError, 'stub this method in your tests'
28
28
  end
29
29
 
30
- def self.debug(_msg)
30
+ def self.debug(_msg, _options = {})
31
31
  fail NotImplementedError, 'stub this method in your tests'
32
32
  end
33
33
 
34
- def self.deprecation(_msg)
34
+ def self.deprecation(_msg, _options = {})
35
35
  fail NotImplementedError, 'stub this method in your tests'
36
36
  end
37
37
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module Compat
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
@@ -18,14 +18,24 @@ RSpec.describe Guard::MyPlugin, exclude_stubs: [Guard::Plugin] do
18
18
  end
19
19
 
20
20
  it 'uses the notifier' do
21
- expect(Guard::Notifier).to receive(:notify).with('foo', title: 'bar')
21
+ expect(Guard::Notifier).to receive(:notify).with('foo')
22
22
  subject.start
23
23
  end
24
24
 
25
+ it 'uses the notifier with options' do
26
+ expect(Guard::Notifier).to receive(:notify).with('foo', title: 'bar')
27
+ subject.run_all
28
+ end
29
+
25
30
  %w(info warning error deprecation debug).each do |type|
26
31
  it "outputs #{type} messages" do
27
32
  expect(Guard::UI).to receive(type.to_sym).with('foo')
28
33
  subject.start
29
34
  end
35
+
36
+ it "outputs #{type} messages with options" do
37
+ expect(Guard::UI).to receive(type.to_sym).with('foo', bar: :baz)
38
+ subject.run_all
39
+ end
30
40
  end
31
41
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-compat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cezary Baginski