Sha256: 37bdced895996bd4a775138426767614581406414625dedadeca8a5fadaf38ec

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe Walruz do

  it "should have a policies method" do
    Walruz.should respond_to(:policies)
  end
  
  describe '.policies' do
    
    it "should return all the policies created that have a label" do
      Walruz.policies.should_not be_nil
      Walruz.policies[:author_policy].should be_nil
      Walruz.policies[:in_colaboration].should == AuthorInColaborationPolicy
      Walruz.policies[:colaborating_with_john_policy].should == ColaboratingWithJohnPolicy
    end
    
  end
  
  describe ".fetch_policy" do
    
    it "should grab the policy if this is registered" do
      Walruz.fetch_policy(:in_colaboration).should == AuthorInColaborationPolicy
    end
    
    it "should raise an Walruz::ActionNotFound exception if the policy is not registered" do
      lambda do
        Walruz.fetch_policy(:author_in_colaboration_policy)
      end.should raise_error(Walruz::ActionNotFound)
    end
    
  end

  describe ".version" do

    it "should return a string representing the current version" do
      require 'yaml'
      version = ::YAML.load_file(File.dirname(__FILE__) + "/../../VERSION.yml")
      Walruz.version.should == "#{version[:major]}.#{version[:minor]}.#{version[:patch]}"
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
walruz-0.0.13 spec/walruz/walruz_spec.rb
walruz-0.0.12 spec/walruz/walruz_spec.rb
walruz-0.0.11 spec/walruz/walruz_spec.rb