Sha256: 04e14ad09fd52480ff46def7b393972101777cea9969cb7b6cab84b06366acb0

Contents?: true

Size: 944 Bytes

Versions: 3

Compression:

Stored size: 944 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')

describe Viking do

 describe ".connect" do
    it "should load the Defensio engine" do
      Viking.connect('defensio', {}).should be_a_kind_of(Viking::Defensio)
    end
  
    it "should load the Akismet engine" do
      Viking.connect('akismet', {}).should be_a_kind_of(Viking::Akismet)
    end
  
    it "should be nil if the engine is nil" do
      Viking.connect(nil, {}).should be_nil
    end
  
    it "should be nil if the engine is blank" do
      Viking.connect('', {}).should be_nil
    end
  end
  
  describe ".enabled?" do
    it "should not be enabled if a default instance has not be initialized" do
      Viking.should_not be_enabled
    end
    
    it "should be enabled if a default instance has been initialized" do
      Viking.default_engine  = 'defensio'
      Viking.connect_options = '1234abc'
      
      Viking.should be_enabled
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vikinggem-0.0.3 spec/lib/viking_spec.rb
vikinggem-0.0.2 spec/lib/viking_spec.rb
vikinggem-0.0.1 spec/lib/viking_spec.rb