Sha256: 3b2527a5285c38e578107fd96fe5c78a35467be8b3aebdd984028f46ff8f7ff7

Contents?: true

Size: 897 Bytes

Versions: 1

Compression:

Stored size: 897 Bytes

Contents

require "spec_helper"

describe UniformNotifier::Raise do
  it "should not notify message" do
    UniformNotifier::Raise.inline_notify("notification").should be_nil
  end

  it "should raise error of the default class" do
    UniformNotifier.raise = true
    expect {
      UniformNotifier::Raise.inline_notify("notification")
    }.to raise_error(UniformNotifier::Raise::UniformNotifierException, "notification")
  end

  it "allows the user to override the default exception class" do
    klass = Class.new(Exception)
    UniformNotifier.raise = klass
    expect {
      UniformNotifier::Raise.inline_notify("notification")
    }.to raise_error(klass, "notification")
  end

  it "can be turned from on to off again" do
    UniformNotifier.raise = true
    UniformNotifier.raise = false

    expect {
      UniformNotifier::Raise.inline_notify("notification")
    }.not_to raise_error
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
uniform_notifier-1.3.0 spec/uniform_notifier/raise_spec.rb