Sha256: d68e7e5b174d950f059ab26c08e7f7e68c314b869e78e3b8b0d9cec3794119dc

Contents?: true

Size: 689 Bytes

Versions: 2

Compression:

Stored size: 689 Bytes

Contents

require 'spec_helper'

shared_examples_for "properties" do
  subject { role }
  its(:kind) { should == kind }
  its(:id) { should == id }
end

describe Conjur::Role do
  let(:account) { "the-account" }
  context "#new" do
    let(:kind) { "test" }
    let(:role) { Conjur::API.new_from_key('the-user', 'the-key').role([ account, kind, id ].join(":")) }
    let(:token) { 'the-token' }
    before {
      Conjur::TokenCache.stub(:fetch).and_return token
    }
    context "with plain id" do
      let(:id) { "foo" }
      it_should_behave_like "properties"
    end
    context "with more complex id" do
      let(:id) { "foo/bar" }
      it_should_behave_like "properties"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
conjur-api-2.2.2 spec/lib/role_spec.rb
conjur-api-2.2.1 spec/lib/role_spec.rb