boty 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/boty/rspec.rb +38 -0
- data/lib/boty/version.rb +1 -1
- data/template/project/Gemfile +4 -0
- data/template/project/Rakefile +4 -0
- data/template/project/spec/script/ping_spec.rb +7 -0
- data/template/project/spec/spec_helper.rb +9 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bf71695e734493e496a84de1edc72ad4d1efdd8
|
4
|
+
data.tar.gz: 35449d7a8978b5c3543d3b3041e7c47c29cb737f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffd4910d8a3de3f7f5d51e1d256ede4404d532074f9fb7ed780c4360e74a32747f1c0bbbad2ac50a6369d63e345e3bdfc0705ad677eed1dea733269f9e1dca05
|
7
|
+
data.tar.gz: 10f90b4d27edbc3a12d90018d584d479f09195d1b582bf6070126f8f52c5e0175d856d1ceedee09d4479bed73d3c9d41247c16349a1bcc846361ab2696411ce1
|
data/Gemfile.lock
CHANGED
data/lib/boty/rspec.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
module Boty
|
2
|
+
module RSpec
|
3
|
+
module Bot
|
4
|
+
def self.included(base)
|
5
|
+
base.instance_eval do
|
6
|
+
let(:bot) {
|
7
|
+
bot = Boty::Bot.new(
|
8
|
+
{"id" => "1234", "name" => "bot"},
|
9
|
+
Boty::Session.new(ENV["SLACK_COMPANY"] || "acme")
|
10
|
+
)
|
11
|
+
|
12
|
+
class << bot
|
13
|
+
attr_accessor :_response
|
14
|
+
|
15
|
+
def say(message)
|
16
|
+
@_response = message
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
bot
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def message_event(text)
|
25
|
+
bot.event "type" => "message", "text" => text
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
::RSpec::Matchers.define :have_responded do |expected|
|
31
|
+
match do |bot|
|
32
|
+
response = bot._response
|
33
|
+
bot._response = nil
|
34
|
+
response == expected
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/boty/version.rb
CHANGED
data/template/project/Gemfile
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Valeriano
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -178,6 +178,7 @@ files:
|
|
178
178
|
- lib/boty/cli.rb
|
179
179
|
- lib/boty/dsl.rb
|
180
180
|
- lib/boty/message.rb
|
181
|
+
- lib/boty/rspec.rb
|
181
182
|
- lib/boty/session.rb
|
182
183
|
- lib/boty/version.rb
|
183
184
|
- lib/tasks/.keep
|
@@ -188,10 +189,13 @@ files:
|
|
188
189
|
- template/project/Gemfile
|
189
190
|
- template/project/Procfile.tt
|
190
191
|
- template/project/README.md
|
192
|
+
- template/project/Rakefile
|
191
193
|
- template/project/app/.empty
|
192
194
|
- template/project/bot.tt
|
193
195
|
- template/project/script/ping.rb
|
194
196
|
- template/project/spec/.empty
|
197
|
+
- template/project/spec/script/ping_spec.rb
|
198
|
+
- template/project/spec/spec_helper.rb
|
195
199
|
homepage: http://github.com/ricardovaleriano/boty
|
196
200
|
licenses:
|
197
201
|
- MIT
|