Skip to content

Commit

Permalink
Return the result of tempFile instead of of sleep.
Browse files Browse the repository at this point in the history
"sleep" returns sleep time, which is integer.
Therefore "apply" ends up always returning a truthy value.
  • Loading branch information
kamatama41 committed Dec 25, 2017
1 parent 4cdf45a commit 6b38dd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def tempfile(content, options = {})
end

def apply(cli = client)
tempfile(yield) do |f|
result = tempfile(yield) do |f|
begin
cli.apply(f.path)
rescue Aws::IAM::Errors::EntityTemporarilyUnmodifiable, Aws::IAM::Errors::Throttling, Aws::IAM::Errors::NoSuchEntity
Expand All @@ -77,6 +77,7 @@ def apply(cli = client)
end

sleep ENV['APPLY_WAIT'].to_i
result
end

def export(options = {})
Expand Down

0 comments on commit 6b38dd7

Please sign in to comment.