File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
elasticgraph-warehouse_lambda/spec/unit/elastic_graph Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,17 @@ module ElasticGraph
7070 end
7171
7272 it "raises an error if `aws_region` is not configured and `AWS_REGION` env var is not set" do
73- warehouse_lambda = build_warehouse_lambda ( aws_region : nil )
73+ # Clear all AWS region sources to ensure MissingRegionError is raised.
74+ # We must also reset `Aws.shared_config` since it caches parsed config from ~/.aws/config.
75+ with_env ( "AWS_REGION" => nil , "AWS_DEFAULT_REGION" => nil , "AWS_CONFIG_FILE" => "/nonexistent" ) do
76+ ::Aws . instance_variable_set ( :@shared_config , nil )
7477
75- expect {
76- warehouse_lambda . s3_client
77- } . to raise_error ::Aws ::Errors ::MissingRegionError
78+ warehouse_lambda = build_warehouse_lambda ( aws_region : nil )
79+
80+ expect {
81+ warehouse_lambda . s3_client
82+ } . to raise_error ::Aws ::Errors ::MissingRegionError
83+ end
7884 end
7985 end
8086 end
You can’t perform that action at this time.
0 commit comments