Sha256: 52594f9965a79d9e3a48628838cf66e8158f7551e13c69a875cedccf7aeb5f14
Contents?: true
Size: 1.56 KB
Versions: 1
Compression:
Stored size: 1.56 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 it 'should fetch anonymous policies with a specified label' do new_policy = Walruz::Utils.any(AuthorInColaborationPolicy, ColaboratingWithJohnPolicy) new_policy.set_policy_label(:crazy_policy) Walruz.fetch_policy(:crazy_policy).should == new_policy 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
walruz-0.0.14 | spec/walruz/walruz_spec.rb |