k1LoW / awspec

RSpec tests for your AWS resources.
MIT License
1.17k stars 192 forks source link

Fixed a bug when a bucket was placed in us-east-1 #533

Closed soruma closed 3 years ago

soruma commented 3 years ago

If a bucket is placed in us-east-1, location_constraint will return blank.

For example, when I wrote the following code, an error occurred.

require 'spec_helper'

describe s3_bucket('awspec-test') do
  it { should have_location('us-east-1') }
end
s3_bucket 'awspec-test'
  is expected to have location "us-east-1" (FAILED - 1)

Failures:

  1) s3_bucket 'awspec-test' is expected to have location "us-east-1"
     Failure/Error: it { should have_location('us-east-1') }
       expected `s3_bucket 'awspec-test'.has_location?("us-east-1")` to be truthy, got false
     # ./spec/s3_spec.rb:6:in `block (2 levels) in <top (required)>'

With this change, if location_constraint is blank, it will be recognized as us-east-1.

ref: https://github.com/k1LoW/awspec/pull/529#issuecomment-819875870

k1LoW commented 3 years ago

Released as v1.24.1.