cinch-test 0.1.1 → 0.1.3

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
- !binary "U0hBMQ==":
3
- metadata.gz: ffa5c1ce20e4f337f9e1f4566ae8e26cf4dc0018
4
- data.tar.gz: 60199f145b4f948f7891c45f2400867cb702e369
2
+ SHA1:
3
+ metadata.gz: 3433089552f4db227e93b0da092ab9aa9f4ebda4
4
+ data.tar.gz: 3a7310052dd07625b7c7737ac5e3e956d841b99b
5
5
  SHA512:
6
- metadata.gz: bfd8b2b23ca8531736f584370e7534fb87a78ee7b55fa5825ef8b42ed49564dc5bb9186572b72a7beb9b495bdc544475019a038f524ace0fabeba844ddd16763
7
- data.tar.gz: 9131e5744509a6ec3d9e53c3fe2c1eeb0d4e00fcead755592ee936dc83f63bfd8e23d57ba02b02611871da4b566053655c68ddbaf7e0237f4c244492695368a7
6
+ metadata.gz: b0516fe1ac721567dffdd028ad4689f47a8d281595c45c66f2027d8a9c66a1bdfb227933f82b1c9e7b7d9f469f3d0bf269fc64fe24fef1c7b8dc9742c45296d7
7
+ data.tar.gz: 8dace2f3fa781dca807ef5e44cdda915b7da0df00ce1735a3c2a131e13c934a02350ece007c5f26cea9cb8e25262cfd797a753674e78d77ddf39630540d11429
@@ -1,8 +1,16 @@
1
1
  language: ruby
2
+ addons:
3
+ code_climate:
4
+ repo_token: 5b977f219572383949d6c4a2bc00864e6bc38c8c0e8f9e42bc79a7935eeed1a2
5
+ before_install:
6
+ - gem update --system
7
+ - gem update bundler
2
8
  env:
3
9
  global:
4
10
  - "JRUBY_OPTS=-Xcext.enabled=true"
5
11
  rvm:
12
+ - 2.3.0
13
+ - 2.2.0
6
14
  - 2.1.0
7
15
  - 2.0.0
8
16
  - 1.9.3
@@ -15,9 +23,13 @@ rvm:
15
23
  - ree
16
24
  matrix:
17
25
  allow_failures:
26
+ - rvm: 1.9.3
27
+ - rvm: 1.9.2
28
+ - rvm: 1.8.7
18
29
  - rvm: 1.8.7
19
30
  - rvm: ree
20
31
  - rvm: jruby-18mode
21
32
  - rvm: jruby-19mode
22
33
  - rvm: jruby-head
34
+ - rvm: ruby-head
23
35
  fast_finish: true
data/README.md CHANGED
@@ -15,6 +15,9 @@
15
15
  with `get_replies(message)`
16
16
 
17
17
  ## Changelog
18
+ * 0.1.3 (April 25, 2016)
19
+ * [Bug Fix] Responses for private messages no longer fire twice.
20
+ * [Bug Fix] Avoid a @channel not initialized warning for private messages.
18
21
  * 0.0.4 (July 2, 2013)
19
22
  * [Bug Fix] Should now capture any user.send|notice|privmsg, channel.send|action events that
20
23
  were previously ignored.
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
21
21
 
22
22
  gem.add_development_dependency 'rake', '~> 10'
23
23
  gem.add_development_dependency 'rspec', '~> 3'
24
- gem.add_development_dependency 'coveralls', '~> 0.7'
24
+ gem.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
25
25
 
26
26
  gem.add_dependency 'cinch', '~> 2'
27
27
  end
@@ -54,11 +54,11 @@ module Cinch
54
54
  @user = Cinch::User.new(opts.delete(:nick) { 'test' }, bot)
55
55
  if opts.key?(:channel)
56
56
  @channel = Cinch::Channel.new(opts.delete(:channel), bot)
57
+ @target = @channel
58
+ else
59
+ @target = @user
57
60
  end
58
61
 
59
- # set the message target
60
- @target = @channel || @user
61
-
62
62
  @bot.user_list.find_ensured(nil, @user.nick, nil)
63
63
  end
64
64
  end
@@ -175,7 +175,7 @@ module Cinch
175
175
  # If the message is :private also trigger :message
176
176
  events << :message if events.include?(:private)
177
177
 
178
- events
178
+ events.uniq
179
179
  end
180
180
  end
181
181
  end
@@ -1,6 +1,6 @@
1
1
  module Cinch
2
2
  # Versioning Info
3
3
  module Test
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.3'
5
5
  end
6
6
  end
@@ -39,6 +39,12 @@ describe Cinch::Test do
39
39
  expect(replies.first.text).to eq('bar reply')
40
40
  end
41
41
 
42
+ it 'sent directly to bot get correct number of replies' do
43
+ message = make_message(@bot, '!bar')
44
+ replies = get_replies(message)
45
+ expect(replies.size).to eq(1)
46
+ end
47
+
42
48
  it 'sent directly to a test bot and can receive a prefixed reply' do
43
49
  replies = get_replies(make_message(@bot, '!baz'))
44
50
  expect(replies.first.text).to eq('test: baz reply')
@@ -55,6 +61,12 @@ describe Cinch::Test do
55
61
  expect(replies.first.text).to eq('loves shellfish')
56
62
  end
57
63
 
64
+ it 'sent to a channel get correct number of replies' do
65
+ message = make_message(@bot, '!bar', channel: '#test')
66
+ replies = get_replies(message)
67
+ expect(replies.size).to eq(1)
68
+ end
69
+
58
70
  it 'should trigger listeners' do
59
71
  message = make_message(@bot, 'blah', channel: '#test')
60
72
  expect(get_replies(message)).to_not be_empty
@@ -1,11 +1,5 @@
1
- require 'coveralls'
2
- require 'simplecov'
3
-
4
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
5
- SimpleCov::Formatter::HTMLFormatter,
6
- Coveralls::SimpleCov::Formatter
7
- ]
8
- SimpleCov.start
1
+ require "codeclimate-test-reporter"
2
+ CodeClimate::TestReporter.start
9
3
 
10
4
  require 'cinch/test'
11
5
  require 'my_plugin'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Adkisson
@@ -9,62 +9,62 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-31 00:00:00.000000000 Z
12
+ date: 2016-04-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '10'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '10'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rspec
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ~>
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
34
  version: '3'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ~>
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '3'
42
42
  - !ruby/object:Gem::Dependency
43
- name: coveralls
43
+ name: codeclimate-test-reporter
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ~>
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '0.7'
48
+ version: '0.4'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ~>
53
+ - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '0.7'
55
+ version: '0.4'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: cinch
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ~>
60
+ - - "~>"
61
61
  - !ruby/object:Gem::Version
62
62
  version: '2'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ~>
67
+ - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: '2'
70
70
  description: A collection of utility methods, mocks and methods for testing Cinch
@@ -75,8 +75,8 @@ executables: []
75
75
  extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
- - .gitignore
79
- - .travis.yml
78
+ - ".gitignore"
79
+ - ".travis.yml"
80
80
  - Gemfile
81
81
  - README.md
82
82
  - Rakefile
@@ -96,17 +96,17 @@ require_paths:
96
96
  - lib
97
97
  required_ruby_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - ! '>='
99
+ - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - ! '>='
104
+ - - ">="
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
108
  rubyforge_project:
109
- rubygems_version: 2.2.2
109
+ rubygems_version: 2.4.8
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Helpers for testing Cinch Plugins