spec/logger_spec.rb in act-fluent-logger-rails-0.1.4 vs spec/logger_spec.rb in act-fluent-logger-rails-0.1.5

- old
+ new

@@ -3,13 +3,15 @@ describe ActFluentLoggerRails::Logger do before do - Rails = double("Rails", env: "test") - Rails.stub_chain(:application, :config, :log_level).and_return(:debug) - Rails.stub_chain(:application, :config, :log_tags=) + unless self.class.const_defined?(:Rails) + Rails = double("Rails", env: "test") + Rails.stub_chain(:application, :config, :log_level).and_return(:debug) + Rails.stub_chain(:application, :config, :log_tags=) + end class MyLogger attr_accessor :log def post(tag, map) @log ||= [] @@ -69,11 +71,11 @@ let(:fluentd_url) { "http://fluentd.example.com:42442/hoge?messages_type=string" } describe ".parse_url" do subject { described_class.parse_url(fluentd_url) } it { expect(subject['tag']).to eq 'hoge' } - it { expect(subject['host']).to eq 'fluentd.example.com' } - it { expect(subject['port']).to eq 42442 } + it { expect(subject['fluent_host']).to eq 'fluentd.example.com' } + it { expect(subject['fluent_port']).to eq 42442 } it { expect(subject['messages_type']).to eq 'string' } end end end