Sha256: d846a7d28417f99b371c1173670fc5c0a95bfad559cc50178aaaed1ea903055b
Contents?: true
Size: 1.07 KB
Versions: 1
Compression:
Stored size: 1.07 KB
Contents
require 'spec_helper' require 'conjur/api' describe Conjur::Resource do let(:uuid) { "ddd1f59a-494d-48fb-b045-0374c4a6eef9" } context "identifier" do include Conjur::Escape let(:resource) { Conjur::Resource.new("#{Conjur::Authz::API.host}/#{kind}/#{path_escape identifier}") } context "Object with an #id" do let(:kind) { "host" } let(:identifier) do Conjur::Host.new("#{Conjur::Core::API.host}/hosts/foobar", {}) end it "identifier should obtained from the id" do resource.identifier.should == "foobar" end end [ [ "foo", "bar/baz" ], [ "f:o", "bar" ], [ "@f", "bar.baz" ], [ "@f", "bar baz" ], [ "@f", "bar?baz" ] ].each do |p| context "of /#{p[0]}/#{p[1]}" do let(:kind) { p[0] } let(:identifier) { p[1] } context "resource_kind" do subject { resource.kind } specify { should == p[0] } end context "resource_id" do subject { resource.identifier } specify { should == ( p[1] ) } end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
conjur-api-2.0.1 | spec/lib/resource_spec.rb |