spec/outputs/hipchat_spec.rb in logstash-output-hipchat-4.0.5 vs spec/outputs/hipchat_spec.rb in logstash-output-hipchat-4.0.6
- old
+ new
@@ -1,9 +1,9 @@
# encoding: utf-8
+require_relative "../spec_helper"
require "logstash/outputs/hipchat"
require "logstash/event"
-require_relative "../spec_helper"
describe LogStash::Outputs::HipChat do
let(:token) { "secret" }
let(:message) { "foobar" }
let(:event) { LogStash::Event.new({ "message" => message }) }
@@ -41,11 +41,11 @@
"my_color" => color,
"from_who" => from})
}
let(:options) {
- super.merge({
+ super().merge({
"token" => "secret",
"room_id" => "%{my_room}",
"from" => "%{from_who}",
"color" => "%{my_color}",
"trigger_notify" => trigger_notify
@@ -67,14 +67,24 @@
include_examples "sending events"
end
context "specified host" do
let(:host) { "local.dev" }
- let(:options) { super.merge({ "host" => host }) }
+ let(:options) { super().merge({ "host" => host }) }
before do
expect(HipChat::Client).to receive(:new).with(token, :api_version => "v2", :server_url => "https://#{host}").and_return({ room_id => hipchat })
end
include_examples "sending events"
end
-end
+
+ describe "debugging `token`" do
+
+ it "should not show origin value" do
+ expect(output.logger).to receive(:debug).with('<password>')
+
+ output.register
+ output.logger.send(:debug, output.token.to_s)
+ end
+ end
+end
\ No newline at end of file