lita 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73a99962e90c5ed2aa41e8d8a728abdd0a707051
4
- data.tar.gz: 1b9026e1e1d32e693d67d13a40fe1fa412982930
3
+ metadata.gz: d9bd8c0df22178884dc917ba0160f0eb1bc3b2dc
4
+ data.tar.gz: 79089bd4df8880b869b444b7dc98e9bb492fde20
5
5
  SHA512:
6
- metadata.gz: 5abc300962d3cdfbe95a1d2882acc8c79cdd4b259819badc7d396ca8b2a83aed37176a4c8c92721926810706bb3cd9a27cbf4d3cf2613aa3f166d53e5420e34b
7
- data.tar.gz: b48afb57c7cb94f560ebb4ff0a7a88ba390759720020c8085868d6a748e541c338317bbb0837902183f61a95c1a4ca9e7c50677ce3478511bee80204bc97723a
6
+ metadata.gz: 4de9444af3c84c039b113a5f3a5a0659cfb91f4438b607f61f5e3030b03cd90cd950403f855dc0e9e208a8324c535f85fba61628d7ac46f346947190b7d0eea5
7
+ data.tar.gz: 5bca9f0a44ac91b26e3519f02f9add4bb0569624d12f76b99102e5ae40057975744c7b0dc46b9c2a0fe26c0865697a69e83360c38b1c0a3ed0e91d2732693e30
@@ -67,6 +67,7 @@ LOG
67
67
  #{e.message}
68
68
  #{e.backtrace.join("\n")}
69
69
  ERROR
70
+ raise e if rspec_loaded?
70
71
  end
71
72
  end
72
73
  end
@@ -116,6 +117,12 @@ ERROR
116
117
 
117
118
  true
118
119
  end
120
+
121
+ # Checks if RSpec is loaded. If so, assume we are testing and let handler
122
+ # exceptions bubble up.
123
+ def rspec_loaded?
124
+ defined?(::RSpec)
125
+ end
119
126
  end
120
127
 
121
128
  # @param robot [Lita::Robot] The currently running robot.
@@ -1,4 +1,4 @@
1
1
  module Lita
2
2
  # The current version of Lita.
3
- VERSION = "2.1.0"
3
+ VERSION = "2.1.1"
4
4
  end
@@ -93,11 +93,17 @@ describe Lita::Handler, lita: true do
93
93
 
94
94
  it "logs exceptions but doesn't crash the bot" do
95
95
  allow(message).to receive(:body).and_return("#{robot.name}: danger")
96
+ allow(handler_class).to receive(:rspec_loaded?).and_return(false)
96
97
  expect(Lita.logger).to receive(:error).with(
97
98
  %r{Lita::Handlers::Test crashed}
98
99
  )
99
100
  expect { handler_class.dispatch(robot, message) }.not_to raise_error
100
101
  end
102
+
103
+ it "re-raises exceptions when testing with RSpec" do
104
+ allow(message).to receive(:body).and_return("#{robot.name}: danger")
105
+ expect { handler_class.dispatch(robot, message) }.to raise_error
106
+ end
101
107
  end
102
108
 
103
109
  describe ".namespace" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Cuadra