Skip to content

Commit

Permalink
[BGBUILD-277] Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
msavy committed Aug 23, 2011
1 parent ae42b95 commit 55c64c6
Show file tree
Hide file tree
Showing 5 changed files with 155 additions and 158 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
v0.9.5

* [BGBUILD-294] Package aws-sdk 1.1.1 and update dependency
* [BGBUILD-277] When delivering as AMI, the EC2 region should match S3 bucket's region (location constraint)

v0.9.4

Expand Down
4 changes: 2 additions & 2 deletions lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def execute
@s3helper.delete_folder(asset_bucket, ami_dir) # Avoid triggering dupe detection
end

if ami_manifest_key.exists? or @plugin_config['snapshot']
if !ami_manifest_key.exists? or @plugin_config['snapshot']
@log.info "Doing bundle/snapshot"
bundle_image(@previous_deliverables)
fix_sha1_sum
Expand Down Expand Up @@ -203,7 +203,7 @@ def ami_key(appliance_name, path)

@log.info "Determining snapshot name"
snapshot = 1
while @s3helper.stub_s3obj(asset_bucket, "#{base_path}-SNAPSHOT-#{snapshot}/#{@appliance_config.hardware.arch}/").exists?
while @s3helper.stub_s3obj(asset_bucket(), "#{base_path}-SNAPSHOT-#{snapshot}/#{@appliance_config.hardware.arch}/").exists?
snapshot += 1
end
# Reuse the last key (if there was one)
Expand Down
1 change: 1 addition & 0 deletions rubygem-boxgrinder-build.spec
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ popd
* Thu Aug 23 2011 Marek Goldmann <mgoldman@redhat.com> - 0.9.5-1
- Upstream release: 0.9.
- [BGBUILD-294] Package aws-sdk 1.1.1 and update dependency
- [BGBUILD-277] When delivering as AMI, the EC2 region should match S3 bucket's region (location constraint)

* Fri Aug 12 2011 Marc Savy <msavy@redhat.com> - 0.9.4-1
- Upstream release: 0.9.4
Expand Down
16 changes: 0 additions & 16 deletions spec/helpers/s3-helper-spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,6 @@ module BoxGrinder
end
end

describe ".object_exists?" do

it "should return true if the object exists" do
@s3obj.stub!(:exists?).and_return(true)
@s3obj.should_receive(:exists?).and_return(true)
@s3helper.object_exists?(@s3obj).should == true
end

it "should return false if the object does not exist" do
@s3obj.stub!(:exists?).and_return(false)
@s3obj.should_receive(:exists?).and_return(false)
@s3helper.object_exists?(@s3obj).should == false
end

end

describe ".delete_folder" do

it "should delete a folder from a bucket" do
Expand Down
Loading

0 comments on commit 55c64c6

Please sign in to comment.