Sha256: b126bbb3b1ed25b62f9213bc1a51c625957c92a8c0da303f37eaf4efdc3344be

Contents?: true

Size: 584 Bytes

Versions: 2

Compression:

Stored size: 584 Bytes

Contents

require "spec_helper"

class Rails
  # mock Rails
end

RSpec.describe UniformNotifier::RailsLogger do
  it "should not notify rails logger" do
    expect(UniformNotifier::RailsLogger.out_of_channel_notify(:title => "notify rails logger")).to be_nil
  end

  it "should notify rails logger" do
    logger = double("logger")
    expect(Rails).to receive(:logger).and_return(logger)
    expect(logger).to receive(:warn).with("notify rails logger")

    UniformNotifier.rails_logger = true
    UniformNotifier::RailsLogger.out_of_channel_notify(:title => "notify rails logger")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
uniform_notifier-1.11.0 spec/uniform_notifier/rails_logger_spec.rb
uniform_notifier-1.10.0 spec/uniform_notifier/rails_logger_spec.rb