lita 4.3.1 → 4.3.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: 6adaec62407df746e96dc8c3ff5ee2149cb63ad9
4
- data.tar.gz: 9543cb670c104ef5869072b5b695f2f8a7a1227b
3
+ metadata.gz: 1bdd0419bd6701e21efff584a64c111fc1459f61
4
+ data.tar.gz: b5344ba16def3e3f64436bbc8530de08874cc5c7
5
5
  SHA512:
6
- metadata.gz: 2da5ab958353ca917d05585682639a967608ac5f200156dd9638bf8a29e5108174e3505bec1bc1570e51b235d369eb74054a948cc9dba0c15167f3d23b7a221e
7
- data.tar.gz: f1cbee5f4a72e166f2250f0bc45c0e87aef25692dcbc06db169c5ef6628117b4a3d156bd2edf4e96d5f57b7683e8d4d60f83bea2f9fe42fa8e776bf8b7aa4b1d
6
+ metadata.gz: 09897b35e777fd74d4f9a340dd08a079795458e6ac5f2ddb0f6886003a449a0144b461c312e7108a9bf2919b935106bd463a99a877ce962af38a04e4cfbe953e
7
+ data.tar.gz: 48dbf19395304d6fbee73486ce28992bb8bc4b2c16b6a728f342c3c0035438a0bb98c9dc2637605f5ca9f08e05e56dde34acb0c713a4f4e9d082e702f9d1f7ac
@@ -10,7 +10,8 @@ module Lita
10
10
  # @return [void]
11
11
  def run
12
12
  user = User.create(1, name: "Shell User")
13
- @source = Source.new(user: user)
13
+ room = robot.config.adapters.shell.private_chat ? nil : "shell"
14
+ @source = Source.new(user: user, room: room)
14
15
  puts t("startup_message")
15
16
  robot.trigger(:connected)
16
17
 
@@ -1,4 +1,4 @@
1
1
  module Lita
2
2
  # The current version of Lita.
3
- VERSION = "4.3.1"
3
+ VERSION = "4.3.2"
4
4
  end
@@ -14,12 +14,15 @@ describe Lita::Adapters::Shell, lita: true do
14
14
  subject { described_class.new(robot) }
15
15
 
16
16
  describe "#run" do
17
+ let(:user) { Lita::User.create(1, name: "Shell User") }
18
+
17
19
  before do
18
20
  registry.register_adapter(:shell, described_class)
19
21
  allow(subject).to receive(:puts)
20
22
  allow(Readline).to receive(:readline).and_return("foo", "exit")
21
23
  allow(robot).to receive(:trigger)
22
24
  allow(robot).to receive(:receive)
25
+ allow(Lita::User).to receive(:create).and_return(user)
23
26
  end
24
27
 
25
28
  it "passes input to the Robot and breaks on an exit message" do
@@ -34,6 +37,18 @@ describe Lita::Adapters::Shell, lita: true do
34
37
  subject.run
35
38
  end
36
39
 
40
+ it "sets the room to 'shell' if config.adapters.shell.private_chat is false" do
41
+ registry.config.adapters.shell.private_chat = false
42
+ expect(Lita::Source).to receive(:new).with(user: user, room: "shell")
43
+ subject.run
44
+ end
45
+
46
+ it "sets the room to nil if config.adapters.shell.private_chat is true" do
47
+ registry.config.adapters.shell.private_chat = true
48
+ expect(Lita::Source).to receive(:new).with(user: user, room: nil)
49
+ subject.run
50
+ end
51
+
37
52
  it "triggers a connected event" do
38
53
  expect(robot).to receive(:trigger).with(:connected)
39
54
  subject.run
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "<%= config[:gem_name] %>"
3
- spec.version = "0.0.1"
3
+ spec.version = "0.1.0"
4
4
  spec.authors = ["<%= config[:author] %>"]
5
5
  spec.email = ["<%= config[:email] %>"]
6
6
  spec.description = "TODO: Add a description"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.1
4
+ version: 4.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Cuadra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-19 00:00:00.000000000 Z
11
+ date: 2015-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler