test/acl_test.rb in aws-s3-0.2.1 vs test/acl_test.rb in aws-s3-0.3.0
- old
+ new
@@ -100,10 +100,21 @@
assert !policy.grants.include?(:public_read)
[false, 1, '1'].each do |non_grant|
assert_nil policy.grants.delete(non_grant)
end
end
+
+ def test_grant_list_comparison
+ policy = ACL::Policy.new
+ policy2 = ACL::Policy.new
+
+ grant_names = [:public_read, :public_read_acp, :authenticated_write]
+ grant_names.each {|grant_name| policy.grants << ACL::Grant.grant(grant_name)}
+ grant_names.reverse_each {|grant_name| policy2.grants << ACL::Grant.grant(grant_name)}
+
+ assert_equal policy.grants, policy2.grants
+ end
end
class GrantTest < Test::Unit::TestCase
def test_permission_must_be_valid
grant = ACL::Grant.new
@@ -121,11 +132,11 @@
ACL::Grant.grant :this_is_not_a_stock_grant
end
grant = nil
assert_nothing_raised do
- grant = ACL::Grant.grant :public_read
+ grant = ACL::Grant.grant(:public_read)
end
assert grant
assert_kind_of ACL::Grant, grant
assert_equal 'READ', grant.permission
@@ -238,6 +249,6 @@
end
def acl(options)
options['x-amz-acl']
end
-end
\ No newline at end of file
+end