Sha256: de3b885d211d02787f76cf9d5c9a45517889a9c945e7e23aaf8311f19485b512

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'

describe Silvermoon do
  it "should be valid" do
    Silvermoon.should be_a(Module)
  end

  it { should respond_to(:notify) }

  it "should notify the loaded notifiers" do
    title = 'title'; content = 'content'; url = 'url'

    Silvermoon.loaded_notifiers.each do |notifier|
      notifier.should_receive(:notify).with(title, content, url, {})
    end

    ret = Silvermoon.notify(title, content, url)
    ret.should be_a(Hash)
    ret.keys.should == [ :facebook, :twitter ]
  end

  it "should add notifiers as symbols" do
    Silvermoon.clear_notifiers!
    Silvermoon.add_notifier(:twitter)
    Silvermoon.loaded_notifiers[:twitter].should be_a(Silvermoon::Notifier::Twitter)
  end

  it "should load a notifier by it's symbol" do
    Silvermoon.load_notifier(:twitter).should be_a(Silvermoon::Notifier::Twitter)
  end

  it "should clear its loaded notifiers" do
    Silvermoon.add_notifier(:twitter)
    Silvermoon.clear_notifiers!
    Silvermoon.loaded_notifiers.should == {}
  end

#  it "should have a setup method that accepts a block for configuration" do
#    Silvermoon.should_receive(:add_notifier).with(:twitter)
#    
#    Silvermoon.setup do
#      add_notifier :twitter
#    end
#  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
silvermoon-0.1 spec/silvermoon_spec.rb