Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Refactor endpoint_spec to keep tests concerned with only one thing #36

Merged
merged 1 commit into from

2 participants

@adelevie
Collaborator

If you ever did want to change the default location constraint, it should not effect the defaulting logic itself. This change turns one test into two smaller ones.

@adelevie
Collaborator

I'll leave this open for a few more days if anyone would like to comment. If no one objects, I'm merging this in.

@laurilehmijoki

Looks nice to me.

@adelevie adelevie merged commit 37984ae into laurilehmijoki:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 9, 2013
  1. @adelevie
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 1 deletion.
  1. +7 −1 spec/lib/endpoint_spec.rb
View
8 spec/lib/endpoint_spec.rb
@@ -3,11 +3,15 @@
describe Jekyll::S3::Endpoint do
- it 'uses the "us-east-1" as the default location' do
+ it 'uses the DEFAULT_LOCATION_CONSTRAINT constant to set the default location constraint' do
endpoint = Jekyll::S3::Endpoint.new
endpoint.location_constraint.should eq(Jekyll::S3::Endpoint::DEFAULT_LOCATION_CONSTRAINT)
end
+ it 'uses the "us-east-1" as the default location' do
+ Jekyll::S3::Endpoint::DEFAULT_LOCATION_CONSTRAINT.should eq('us-east-1')
+ end
+
it 'takes a valid location constraint as a constructor parameter' do
endpoint = Jekyll::S3::Endpoint.new('EU')
endpoint.location_constraint.should eq('EU')
@@ -19,3 +23,5 @@
}.to raise_error
end
end
+
+
Something went wrong with that request. Please try again.