-
-
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 #63 from Sija/develop
v1.6
- Loading branch information
Showing
7 changed files
with
101 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require "../spec_helper" | ||
|
||
describe Raven::Context do | ||
{% for key in %i(user extra tags) %} | ||
{% env_key = "SENTRY_CONTEXT_#{key.upcase.id}" %} | ||
|
||
context %(with ENV["{{ env_key.id }}"]?) do | ||
it "initializes from valid JSON-encoded string" do | ||
with_clean_env do | ||
ENV[{{ env_key }}] = {foo: :bar}.to_json | ||
|
||
context = Raven::Context.new | ||
context.{{ key.id }}.should eq({"foo" => "bar"}) | ||
end | ||
end | ||
|
||
it "raises when JSON-encoded string is not a Hash" do | ||
with_clean_env do | ||
ENV[{{ env_key }}] = (0..3).to_a.to_json | ||
|
||
expect_raises(Raven::Error, {{ env_key }}) do | ||
Raven::Context.new | ||
end | ||
end | ||
end | ||
|
||
it "raises on invalid JSON-encoded string" do | ||
with_clean_env do | ||
ENV[{{ env_key }}] = "foo" | ||
|
||
expect_raises(Raven::Error, {{ env_key }}) do | ||
Raven::Context.new | ||
end | ||
end | ||
end | ||
end | ||
{% end %} | ||
end |
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
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,3 +1,3 @@ | ||
module Raven | ||
VERSION = "1.5.5" | ||
VERSION = "1.6.0" | ||
end |