speedflow-plugin-flowdock 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/speedflow/plugin/flowdock.rb +3 -41
- data/lib/speedflow/plugin/flowdock/client.rb +12 -15
- data/lib/speedflow/plugin/flowdock/plugin.rb +36 -0
- data/lib/speedflow/plugin/flowdock/version.rb +1 -1
- data/spec/speedflow/plugin/flowdock/client_spec.rb +7 -2
- data/spec/speedflow/plugin/flowdock/{plugin_core_spec.rb → plugin_spec.rb} +7 -7
- data/spec/speedflow/plugin/flowdock_spec.rb +0 -13
- metadata +10 -14
- data/lib/speedflow/plugin/flowdock/configuration.rb +0 -79
- data/lib/speedflow/plugin/flowdock/plugin_core.rb +0 -66
- data/lib/speedflow/plugin/flowdock/prompt.rb +0 -42
- data/spec/speedflow/plugin/flowdock/configuration_spec.rb +0 -48
- data/spec/speedflow/plugin/flowdock/prompt_spec.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edecbbf442d178fe48d334e12d510ff87ec1a809
|
4
|
+
data.tar.gz: 1d0050478441ba631fce827003dc5db5b24c3b80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa39046538e336e12d2422e2cde9a33e4ca4f59082d232df1c5d6a6d01bf1880bc3287034615775fce8a615a908aab6afb0541ea1af47f0fe5547656c2e66b23
|
7
|
+
data.tar.gz: 72dbe45465b420c08d47442115026c0382ea22f33146a716ffe0f3a4686f4daf80ebba0ae5b0f57bf4c0357902c3afed75f7e6b73904eb138e61ceb6ee762069
|
@@ -1,43 +1,5 @@
|
|
1
|
+
require 'speedflow'
|
2
|
+
|
1
3
|
require 'speedflow/plugin/flowdock/version'
|
2
|
-
require 'speedflow/plugin/flowdock/
|
3
|
-
require 'speedflow/plugin/flowdock/prompt'
|
4
|
-
require 'speedflow/plugin/flowdock/configuration'
|
4
|
+
require 'speedflow/plugin/flowdock/plugin'
|
5
5
|
require 'speedflow/plugin/flowdock/client'
|
6
|
-
|
7
|
-
# Speedflow GEM, help you to boost your flow and keep your time.
|
8
|
-
module Speedflow
|
9
|
-
module Plugin
|
10
|
-
# Flowdock Speedflow plugin.
|
11
|
-
module Flowdock
|
12
|
-
# TODO: Move this system in the core Utils
|
13
|
-
class << self
|
14
|
-
ACTIONS = [
|
15
|
-
:action_notify
|
16
|
-
].freeze
|
17
|
-
|
18
|
-
# @return [Speedflow::Plugin::Flowdock.PluginCore] Plugin.
|
19
|
-
attr_writer :plugin
|
20
|
-
|
21
|
-
# Public: Magic method to route to action
|
22
|
-
#
|
23
|
-
# args - Some arguments :)
|
24
|
-
#
|
25
|
-
# Returns nothing.
|
26
|
-
def method_missing(*args)
|
27
|
-
action = args.first
|
28
|
-
|
29
|
-
raise NoMethodError, action unless ACTIONS.include? action
|
30
|
-
|
31
|
-
plugin.new(args.last).send(action)
|
32
|
-
end
|
33
|
-
|
34
|
-
# Public: Plugin.
|
35
|
-
#
|
36
|
-
# Returns Speedflow::Plugin::Flowdock.PluginCore instance.
|
37
|
-
def plugin
|
38
|
-
@plugin ||= PluginCore
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -5,20 +5,23 @@ module Speedflow
|
|
5
5
|
module Flowdock
|
6
6
|
# Flowdock client
|
7
7
|
class Client
|
8
|
-
# @return [
|
9
|
-
|
8
|
+
# @return [Speedflow::Plugin::Configuration] Plugin configuration.
|
9
|
+
attr_reader :config
|
10
|
+
|
11
|
+
# @return [Speedflow::Plugin::Prompt] Plugin prompt.
|
12
|
+
attr_reader :prompt
|
10
13
|
|
11
14
|
# @return [Flowdock::Client] Flowdock client.
|
12
15
|
attr_writer :flowdock_client
|
13
16
|
|
14
17
|
# Initialize.
|
15
18
|
#
|
16
|
-
# config - Speedflow::Plugin::
|
17
|
-
# prompt - Speedflow::Plugin::
|
19
|
+
# config - <Speedflow::Plugin::Configuration> instance.
|
20
|
+
# prompt - <Speedflow::Plugin::Prompt> instance.
|
18
21
|
#
|
19
22
|
# Examples
|
20
23
|
#
|
21
|
-
# Client.new({}, Speedflow::Plugin::
|
24
|
+
# Client.new({}, Speedflow::Plugin::Prompt.new)
|
22
25
|
# # => <Speedflow::Plugin::Flowdock::Client>
|
23
26
|
#
|
24
27
|
# Returns nothing.
|
@@ -48,22 +51,16 @@ module Speedflow
|
|
48
51
|
def safe
|
49
52
|
yield
|
50
53
|
rescue ::Flowdock::ApiError => exception
|
51
|
-
prompt.errors exception
|
54
|
+
prompt.errors 'Flowdock', exception
|
52
55
|
abort
|
53
56
|
end
|
54
57
|
|
55
58
|
# Public: Flowdock client.
|
56
59
|
#
|
57
|
-
# Returns
|
60
|
+
# Returns <::Flowdock::Client> instance.
|
58
61
|
def flowdock_client
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
# Public: Prompt.
|
63
|
-
#
|
64
|
-
# Returns ::Speedflow::Plugin::Flowdock::Prompt instance.
|
65
|
-
def prompt
|
66
|
-
@prompt ||= ::Speedflow::Plugin::Flowdock::Prompt.new
|
62
|
+
config = { api_token: @config.by_config('token') }
|
63
|
+
@flowdock_client ||= ::Flowdock::Client.new(config)
|
67
64
|
end
|
68
65
|
end
|
69
66
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Speedflow
|
2
|
+
module Plugin
|
3
|
+
module Flowdock
|
4
|
+
# Plugin core
|
5
|
+
class Plugin < Speedflow::Plugin::Abstract
|
6
|
+
# @return [<Speedflow::Flowdock::Client>] Plugin client.
|
7
|
+
attr_writer :client
|
8
|
+
|
9
|
+
# Public: Notify.
|
10
|
+
#
|
11
|
+
# Returns Hash of result.
|
12
|
+
def action_notify
|
13
|
+
flow_id_or_token = config.by_input('flow', config.by_config('flow'))
|
14
|
+
|
15
|
+
message = config.by_input('message')
|
16
|
+
tags = config.by_input('tags').split(',')
|
17
|
+
|
18
|
+
client.notify(flow_id_or_token, message, tags)
|
19
|
+
|
20
|
+
prompt.ok '[FLOWDOCK] Flow was notified'
|
21
|
+
|
22
|
+
# ACTION: action_notify
|
23
|
+
# OUTPUT: { 'message' => String, 'tags' => [] }
|
24
|
+
{ 'message' => message, 'tags' => tags }
|
25
|
+
end
|
26
|
+
|
27
|
+
# Public: Plugin client.
|
28
|
+
#
|
29
|
+
# Returns <Speedflow::Flowdock::Client> instance.
|
30
|
+
def client
|
31
|
+
@client ||= Client.new(@config, @prompt)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -2,13 +2,18 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Speedflow::Plugin::Flowdock::Client do
|
4
4
|
let(:client) do
|
5
|
-
client =
|
5
|
+
client = Speedflow::Plugin::Flowdock::Client.new(double, double)
|
6
6
|
client.flowdock_client = double
|
7
7
|
client
|
8
8
|
end
|
9
9
|
|
10
10
|
it '.notify' do
|
11
|
-
allow(client.
|
11
|
+
allow(client.config)
|
12
|
+
.to receive(:by_config)
|
13
|
+
.with('token')
|
14
|
+
.and_return('XXX')
|
15
|
+
allow(client.flowdock_client)
|
16
|
+
.to receive(:chat_message)
|
12
17
|
|
13
18
|
client.notify('XXX', 'Hello', %w(foo bar baz))
|
14
19
|
end
|
@@ -1,15 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Speedflow::Plugin::Flowdock::
|
3
|
+
describe Speedflow::Plugin::Flowdock::Plugin do
|
4
4
|
let(:plugin) do
|
5
|
-
plugin = ::Speedflow::Plugin::Flowdock::
|
6
|
-
plugin.config = double
|
7
|
-
plugin.prompt = double
|
5
|
+
plugin = ::Speedflow::Plugin::Flowdock::Plugin.new(double, double)
|
8
6
|
plugin.client = double
|
9
7
|
plugin
|
10
8
|
end
|
11
9
|
|
12
|
-
it '.
|
10
|
+
it '.action_notify' do
|
13
11
|
allow(plugin.config)
|
14
12
|
.to receive(:by_config)
|
15
13
|
.with('flow')
|
@@ -26,7 +24,7 @@ describe Speedflow::Plugin::Flowdock::PluginCore do
|
|
26
24
|
.to receive(:by_input)
|
27
25
|
.with('tags')
|
28
26
|
.and_return('foo,bar,baz')
|
29
|
-
|
27
|
+
|
30
28
|
allow(plugin.prompt)
|
31
29
|
.to receive(:ok)
|
32
30
|
.with('[FLOWDOCK] Flow was notified')
|
@@ -35,6 +33,8 @@ describe Speedflow::Plugin::Flowdock::PluginCore do
|
|
35
33
|
.to receive(:notify)
|
36
34
|
.with('XXX', 'Hello', %w(foo bar baz))
|
37
35
|
|
38
|
-
|
36
|
+
expected_hash = { 'message' => 'Hello', 'tags' => %w(foo bar baz) }
|
37
|
+
expect(plugin.action_notify)
|
38
|
+
.to eq expected_hash
|
39
39
|
end
|
40
40
|
end
|
@@ -1,20 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Speedflow::Plugin::Flowdock do
|
4
|
-
let(:plugin) do
|
5
|
-
double(new: double(action_notify: nil))
|
6
|
-
end
|
7
|
-
|
8
4
|
it 'has a version number' do
|
9
5
|
expect(Speedflow::Plugin::Flowdock::VERSION).not_to be nil
|
10
6
|
end
|
11
|
-
|
12
|
-
it 'has an action catcher' do
|
13
|
-
expect { Speedflow::Plugin::Flowdock.action_lol }
|
14
|
-
.to raise_error(NoMethodError)
|
15
|
-
|
16
|
-
Speedflow::Plugin::Flowdock.plugin = plugin
|
17
|
-
|
18
|
-
expect(Speedflow::Plugin::Flowdock.action_notify).to eq nil
|
19
|
-
end
|
20
7
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: speedflow-plugin-flowdock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Breux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: speedflow
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: '0.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: '0.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: flowdock
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.7.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.7.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,15 +178,11 @@ files:
|
|
178
178
|
- lib/speedflow-plugin-flowdock.rb
|
179
179
|
- lib/speedflow/plugin/flowdock.rb
|
180
180
|
- lib/speedflow/plugin/flowdock/client.rb
|
181
|
-
- lib/speedflow/plugin/flowdock/
|
182
|
-
- lib/speedflow/plugin/flowdock/plugin_core.rb
|
183
|
-
- lib/speedflow/plugin/flowdock/prompt.rb
|
181
|
+
- lib/speedflow/plugin/flowdock/plugin.rb
|
184
182
|
- lib/speedflow/plugin/flowdock/version.rb
|
185
183
|
- spec/spec_helper.rb
|
186
184
|
- spec/speedflow/plugin/flowdock/client_spec.rb
|
187
|
-
- spec/speedflow/plugin/flowdock/
|
188
|
-
- spec/speedflow/plugin/flowdock/plugin_core_spec.rb
|
189
|
-
- spec/speedflow/plugin/flowdock/prompt_spec.rb
|
185
|
+
- spec/speedflow/plugin/flowdock/plugin_spec.rb
|
190
186
|
- spec/speedflow/plugin/flowdock_spec.rb
|
191
187
|
homepage: https://github.com/speedflow/speedflow-plugin-flowdock
|
192
188
|
licenses:
|
@@ -1,79 +0,0 @@
|
|
1
|
-
module Speedflow
|
2
|
-
module Plugin
|
3
|
-
module Flowdock
|
4
|
-
# Flowdock Configuration
|
5
|
-
class Configuration
|
6
|
-
CONFIG_KEY = '_config'.freeze
|
7
|
-
PLUGIN_KEY = 'flowdock'.freeze
|
8
|
-
|
9
|
-
# Initialize.
|
10
|
-
#
|
11
|
-
# arguments - Hash of arguments.
|
12
|
-
#
|
13
|
-
# Examples
|
14
|
-
#
|
15
|
-
# Configuration.new({})
|
16
|
-
# # => <Speedflow::Plugin::Flowdock::Configuration>
|
17
|
-
#
|
18
|
-
# Returns nothing.
|
19
|
-
def initialize(arguments)
|
20
|
-
@arguments = arguments
|
21
|
-
end
|
22
|
-
|
23
|
-
# Public: Auth configuration.
|
24
|
-
#
|
25
|
-
# Returns Hash of auth configuration.
|
26
|
-
def auth
|
27
|
-
{
|
28
|
-
api_token: by_config('token')
|
29
|
-
}
|
30
|
-
end
|
31
|
-
|
32
|
-
# Public: Get a specific config.
|
33
|
-
#
|
34
|
-
# key - Key of config.
|
35
|
-
# default_value - Default value.
|
36
|
-
#
|
37
|
-
# Returns value of config key.
|
38
|
-
def by_config(key, default_value = '')
|
39
|
-
if @arguments.key?(CONFIG_KEY) &&
|
40
|
-
@arguments[CONFIG_KEY].key?(PLUGIN_KEY)
|
41
|
-
config = @arguments[CONFIG_KEY][PLUGIN_KEY]
|
42
|
-
end
|
43
|
-
config.key?(key) ? config[key] : default_value
|
44
|
-
end
|
45
|
-
|
46
|
-
# Public: Get an input config by key.
|
47
|
-
#
|
48
|
-
# key - Key of config.
|
49
|
-
# default_value - Default value.
|
50
|
-
#
|
51
|
-
# Returns value of input config key.
|
52
|
-
def by_input(key, default_value = '')
|
53
|
-
if @arguments.key?(key)
|
54
|
-
@arguments[key]['value']
|
55
|
-
else
|
56
|
-
default_value
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# Public: Get an input config by key but required.
|
61
|
-
#
|
62
|
-
# key - Key of config.
|
63
|
-
# default_value - Default value.
|
64
|
-
#
|
65
|
-
# Returns value of input config key or Exception.
|
66
|
-
def by_required_input(key, default_value = '')
|
67
|
-
value = by_input(key, default_value)
|
68
|
-
|
69
|
-
# TODO: Improve communication with core for errors
|
70
|
-
if by_input(key).empty?
|
71
|
-
raise Exception, "Required value for '#{key}'."
|
72
|
-
end
|
73
|
-
|
74
|
-
value
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
module Speedflow
|
2
|
-
module Plugin
|
3
|
-
module Flowdock
|
4
|
-
# Plugin core
|
5
|
-
class PluginCore
|
6
|
-
# @return [Prompt] Plugin prompt.
|
7
|
-
attr_writer :prompt
|
8
|
-
|
9
|
-
# @return [Client] Plugin client.
|
10
|
-
attr_writer :client
|
11
|
-
|
12
|
-
# @return [Config] Plugin config.
|
13
|
-
attr_writer :config
|
14
|
-
|
15
|
-
# Initialize.
|
16
|
-
#
|
17
|
-
# arguments - Hash of arguments.
|
18
|
-
#
|
19
|
-
# Examples
|
20
|
-
#
|
21
|
-
# Plugin.new({})
|
22
|
-
# # => <Speedflow::Plugin::Flowdock::PluginCore>
|
23
|
-
#
|
24
|
-
# Returns nothing.
|
25
|
-
def initialize(arguments)
|
26
|
-
@arguments = arguments
|
27
|
-
end
|
28
|
-
|
29
|
-
# Public: Notify.
|
30
|
-
#
|
31
|
-
# Returns nothing.
|
32
|
-
def action_notify
|
33
|
-
flow_id_or_token = config.by_input('flow', config.by_config('flow'))
|
34
|
-
|
35
|
-
message = config.by_input('message')
|
36
|
-
tags = config.by_input('tags').split(',')
|
37
|
-
|
38
|
-
client.notify(flow_id_or_token, message, tags)
|
39
|
-
|
40
|
-
prompt.ok '[FLOWDOCK] Flow was notified'
|
41
|
-
end
|
42
|
-
|
43
|
-
# Public: Plugin configuration.
|
44
|
-
#
|
45
|
-
# Returns Configuration instance.
|
46
|
-
def config
|
47
|
-
@config ||= Configuration.new(@arguments)
|
48
|
-
end
|
49
|
-
|
50
|
-
# Public: Plugin client.
|
51
|
-
#
|
52
|
-
# Returns Client instance.
|
53
|
-
def client
|
54
|
-
@client ||= Client.new(@config, @prompt)
|
55
|
-
end
|
56
|
-
|
57
|
-
# Public: Plugin prompt.
|
58
|
-
#
|
59
|
-
# Returns Prompt instance.
|
60
|
-
def prompt
|
61
|
-
@prompt ||= Prompt.new
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
require 'tty-prompt'
|
2
|
-
require 'json'
|
3
|
-
|
4
|
-
module Speedflow
|
5
|
-
module Plugin
|
6
|
-
module Flowdock
|
7
|
-
# Plugin prompt
|
8
|
-
class Prompt # < TTY::Prompt
|
9
|
-
# @return [TTY::Prompt] TTY::Prompt.
|
10
|
-
attr_writer :prompt
|
11
|
-
|
12
|
-
# Public: Errors from Flowdock exception.
|
13
|
-
#
|
14
|
-
# exception - Flowdock::ApiError.
|
15
|
-
#
|
16
|
-
# Returns nothing.
|
17
|
-
def errors(exception)
|
18
|
-
prompt.error 'Flowdock errors'
|
19
|
-
prompt.warn exception.message
|
20
|
-
end
|
21
|
-
|
22
|
-
# Delegate.
|
23
|
-
#
|
24
|
-
# method - Method.
|
25
|
-
# args - Arguments.
|
26
|
-
# block - Block.
|
27
|
-
#
|
28
|
-
# Returns wathever.
|
29
|
-
def method_missing(method, *args, &block)
|
30
|
-
prompt.send(method, *args, &block)
|
31
|
-
end
|
32
|
-
|
33
|
-
# Public: TTY prompt.
|
34
|
-
#
|
35
|
-
# Returns ::TTY::Prompt instance.
|
36
|
-
def prompt
|
37
|
-
@prompt ||= ::TTY::Prompt.new
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Speedflow::Plugin::Flowdock::Configuration do
|
4
|
-
let(:config) do
|
5
|
-
message = { 'value' => 'hello' }
|
6
|
-
tags = { 'value' => 'foo,bar,baz' }
|
7
|
-
fd_config = { 'token' => 'foo', 'flow' => 'bar' }
|
8
|
-
config = { 'flowdock' => fd_config }
|
9
|
-
args = { 'tags' => tags, 'message' => message, '_config' => config }
|
10
|
-
Speedflow::Plugin::Flowdock::Configuration.new(args)
|
11
|
-
end
|
12
|
-
|
13
|
-
it '.by_config' do
|
14
|
-
expect(config.by_config('token', 'default'))
|
15
|
-
.to eq 'foo'
|
16
|
-
end
|
17
|
-
|
18
|
-
it '.by_input' do
|
19
|
-
expect(config.by_input('message', 'default'))
|
20
|
-
.to eq 'hello'
|
21
|
-
|
22
|
-
expect(config.by_input('tags'))
|
23
|
-
.to eq 'foo,bar,baz'
|
24
|
-
|
25
|
-
expect(config.by_input('nomessage', 'default'))
|
26
|
-
.to eq 'default'
|
27
|
-
end
|
28
|
-
|
29
|
-
it '.by_required_input' do
|
30
|
-
expect(config.by_required_input('message', 'default'))
|
31
|
-
.to eq 'hello'
|
32
|
-
|
33
|
-
expect { config.by_required_input('nomessage') }
|
34
|
-
.to raise_error(Exception)
|
35
|
-
|
36
|
-
expect { config.by_required_input('nonomessage', 'default') }
|
37
|
-
.to raise_error(Exception)
|
38
|
-
end
|
39
|
-
|
40
|
-
it '.auth' do
|
41
|
-
returned_hash = {
|
42
|
-
api_token: 'foo'
|
43
|
-
}
|
44
|
-
|
45
|
-
expect(config.auth)
|
46
|
-
.to eq returned_hash
|
47
|
-
end
|
48
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Speedflow::Plugin::Flowdock::Prompt do
|
4
|
-
let(:prompt) do
|
5
|
-
prompt = ::Speedflow::Plugin::Flowdock::Prompt.new
|
6
|
-
prompt.prompt = double
|
7
|
-
prompt
|
8
|
-
end
|
9
|
-
let(:exception) do
|
10
|
-
double(message: "Error\n")
|
11
|
-
end
|
12
|
-
|
13
|
-
it '.ok' do
|
14
|
-
allow(prompt.prompt)
|
15
|
-
.to receive(:ok).with('Test')
|
16
|
-
|
17
|
-
expect(prompt.ok('Test'))
|
18
|
-
end
|
19
|
-
|
20
|
-
it '.errors' do
|
21
|
-
allow(prompt.prompt)
|
22
|
-
.to receive(:error).with('Flowdock errors')
|
23
|
-
allow(prompt.prompt)
|
24
|
-
.to receive(:warn).with("Error\n")
|
25
|
-
|
26
|
-
expect(prompt.errors(exception))
|
27
|
-
end
|
28
|
-
end
|