Sha256: 576584aee20face354f10f5f034dd947a3ef1419d00fc25813a3e8823d54b834

Contents?: true

Size: 1.22 KB

Versions: 2

Compression:

Stored size: 1.22 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
      version = YAML.load_file(File.dirname(__FILE__) + "/../../VERSION.yml")
      Walruz.version.should == "#{version[:major]}.#{version[:minor]}.#{version[:patch]}"
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
walruz-0.0.10 spec/walruz/walruz_spec.rb
walruz-0.0.9 spec/walruz/walruz_spec.rb