forked from microformats/microformats-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update configuration with lower values * Update spec_helper, disabling WebMock net connections * Clean up and organize spec files
- Loading branch information
1 parent
8d788c7
commit ff279fa
Showing
11 changed files
with
209 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
describe Microformats::AbsoluteUri, '#absolutize' do | ||
subject { described_class.new(relative, base: base).absolutize } | ||
|
||
context 'when relative is nil' do | ||
let(:relative) { nil } | ||
let(:base) { 'http://example.com' } | ||
|
||
it { is_expected.to eq(base) } | ||
end | ||
|
||
context 'when relative is an empty string' do | ||
let(:relative) { '' } | ||
let(:base) { 'http://example.com' } | ||
|
||
it { is_expected.to eq(base) } | ||
end | ||
|
||
context 'when relative is a valid absolute URI' do | ||
let(:base) { nil } | ||
let(:relative) { 'http://google.com' } | ||
|
||
it { is_expected.to eq('http://google.com') } | ||
end | ||
|
||
context 'when relative is a valid non-absolute URI' do | ||
let(:relative) { 'bar/qux' } | ||
|
||
context 'when base is present but not absolute' do | ||
let(:base) { 'foo' } | ||
|
||
it { is_expected.to eq('bar/qux') } | ||
end | ||
|
||
context 'when base is present and absolute' do | ||
let(:base) { 'http://google.com' } | ||
|
||
it { is_expected.to eq('http://google.com/bar/qux') } | ||
end | ||
|
||
context 'when base is not present' do | ||
let(:base) { nil } | ||
|
||
it { is_expected.to eq('bar/qux') } | ||
end | ||
|
||
context 'when base has a subdir' do | ||
let(:base) { 'http://google.com/asdf.html' } | ||
|
||
it { is_expected.to eq('http://google.com/bar/qux') } | ||
end | ||
end | ||
|
||
context 'when relative is an invalid URI' do | ||
let(:base) { nil } | ||
let(:relative) { 'git@github.com:indieweb/microformats-ruby.git' } | ||
|
||
it { is_expected.to eq(relative) } | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.