Sha256: a027e65c72937a28ee12aab2532c2282d2693525c20a0efc43fd42ed110ac566

Contents?: true

Size: 953 Bytes

Versions: 6

Compression:

Stored size: 953 Bytes

Contents

require "spec_helper"

describe Arrthorizer::Privilege do
  describe :get do
    context "when the privilege set does not exist" do
      it "raises a Privilege::NotFound error" do
        expect {
          Arrthorizer::Privilege.get("computer_says_no")
        }.to raise_error(Arrthorizer::Registry::NotFound)
      end
    end

    context "when the privilege set with the given name exists" do
      let(:name) { "computer_says_hi" }

      before do
        @privilege = Arrthorizer::Privilege.new(name: name)
      end

      it "returns that privilege set" do
        Arrthorizer::Privilege.get(name).should be @privilege
      end
    end

    context "when the parameter is already a privilege set" do
      before do
        @privilege = Arrthorizer::Privilege.new(name: "irrelevant")
      end

      specify "that privilege set is returned" do
        Arrthorizer::Privilege.get(@privilege).should be @privilege
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
arrthorizer-0.1.3 spec/privilege/get_spec.rb
arrthorizer-0.1.2 spec/privilege/get_spec.rb
arrthorizer-0.1.1 spec/privilege/get_spec.rb
arrthorizer-0.1.0 spec/privilege/get_spec.rb
arrthorizer-0.1.0.pre2 spec/privilege/get_spec.rb
arrthorizer-0.1.0.pre spec/privilege/get_spec.rb