-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from Sija/develop
v1.7
- Loading branch information
Showing
31 changed files
with
230 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: raven | ||
version: 1.6.0 | ||
version: 1.7.0 | ||
|
||
authors: | ||
- Sijawusz Pur Rahnama <[email protected]> | ||
|
@@ -15,12 +15,12 @@ development_dependencies: | |
version: ~> 0.4.0 | ||
ameba: | ||
github: crystal-ameba/ameba | ||
version: ~> 0.11.0 | ||
version: ~> 0.13.0 | ||
|
||
targets: | ||
crash_handler: | ||
main: src/crash_handler.cr | ||
|
||
crystal: 0.32.0 | ||
crystal: 0.35.0 | ||
|
||
license: MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
require "../spec_helper" | ||
|
||
class ClientTest < Raven::Client | ||
private class ClientTest < Raven::Client | ||
def generate_auth_header | ||
super | ||
end | ||
|
@@ -10,12 +10,7 @@ class ClientTest < Raven::Client | |
end | ||
end | ||
|
||
def build_configuration | ||
Raven::Configuration.new | ||
.tap(&.dsn = "dummy://12345:[email protected]:3000/sentry/42") | ||
end | ||
|
||
def with_client | ||
private def with_client | ||
yield ClientTest.new(build_configuration) | ||
end | ||
|
||
|
@@ -96,7 +91,7 @@ describe Raven::Client do | |
last_event[:options].should eq({:content_type => "application/octet-stream"}) | ||
last_event[:data].should be_a(String) | ||
io = IO::Memory.new(last_event[:data].as(String)) | ||
Gzip::Reader.open(io) do |gzip| | ||
Compress::Gzip::Reader.open(io) do |gzip| | ||
data = JSON.parse(gzip.gets_to_end) | ||
data.as_h?.should_not be_nil | ||
data["event_id"].should eq(event.id) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,13 +12,13 @@ private class RandomSampleFail < Random::PCG32 | |
end | ||
end | ||
|
||
def with_configuration | ||
private def with_configuration | ||
with_clean_env do | ||
yield Raven::Configuration.new | ||
end | ||
end | ||
|
||
def with_configuration_with_dsn | ||
private def with_configuration_with_dsn | ||
with_configuration do |configuration| | ||
configuration.dsn = "http://12345:[email protected]:3000/sentry/42" | ||
yield configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,24 +16,7 @@ private class InstanceTest < Raven::Instance | |
end | ||
end | ||
|
||
private class LoggerTest < Raven::Logger | ||
getter infos = [] of String | ||
|
||
def info(message, *args) | ||
super.tap do | ||
@infos << message | ||
end | ||
end | ||
end | ||
|
||
def build_configuration | ||
Raven::Configuration.new.tap do |config| | ||
config.dsn = "dummy://12345:[email protected]:3000/sentry/42" | ||
config.logger = LoggerTest.new(nil) | ||
end | ||
end | ||
|
||
def with_instance(context = nil) | ||
private def with_instance(context = nil) | ||
yield InstanceTest.new(context, build_configuration) | ||
end | ||
|
||
|
@@ -214,17 +197,21 @@ describe Raven::Instance do | |
with_instance do |instance| | ||
instance.configuration.silence_ready = false | ||
|
||
instance.report_status | ||
instance.logger.as(LoggerTest).infos.should contain(ready_message) | ||
Log.capture do |logs| | ||
instance.report_status | ||
logs.check(:info, ready_message) | ||
end | ||
end | ||
end | ||
|
||
it "logs nothing if 'silence_ready' option is true" do | ||
with_instance do |instance| | ||
instance.configuration.silence_ready = true | ||
|
||
instance.report_status | ||
instance.logger.as(LoggerTest).infos.should_not contain(ready_message) | ||
Log.capture do |logs| | ||
instance.report_status | ||
logs.empty | ||
end | ||
end | ||
end | ||
|
||
|
@@ -233,8 +220,10 @@ describe Raven::Instance do | |
instance.configuration.silence_ready = false | ||
instance.configuration.dsn = "dummy://foo" | ||
|
||
instance.report_status | ||
instance.logger.as(LoggerTest).infos.first.should contain(not_ready_message) | ||
Log.capture do |logs| | ||
instance.report_status | ||
logs.check(:info, /#{not_ready_message}/) | ||
end | ||
end | ||
end | ||
|
||
|
@@ -243,10 +232,12 @@ describe Raven::Instance do | |
instance.configuration.silence_ready = false | ||
instance.configuration.environments = %w(production) | ||
|
||
instance.report_status | ||
instance.logger.as(LoggerTest).infos.should contain( | ||
"#{not_ready_message}: Not configured to send/capture in environment 'default'" | ||
) | ||
Log.capture do |logs| | ||
instance.report_status | ||
logs.check(:info, | ||
"#{not_ready_message}: Not configured to send/capture in environment 'default'" | ||
) | ||
end | ||
end | ||
end | ||
end | ||
|
@@ -255,7 +246,9 @@ describe Raven::Instance do | |
it "sends the result of Event.capture" do | ||
with_instance do |instance| | ||
event = instance.capture("Test message") | ||
instance.last_sent_event.try(&.id).should eq(event.as?(Raven::Event).try(&.id)) | ||
|
||
last_sent_event = instance.last_sent_event.should_not be_nil | ||
last_sent_event.id.should eq(event.as(Raven::Event).id) | ||
end | ||
end | ||
end | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.