-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move back to share_example usign describe block too
require fixed_values for all specs with as_json example
- Loading branch information
1 parent
7624a04
commit e13d7a4
Showing
11 changed files
with
31 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
shared_examples 'it has symmetric as_json and to_json methods' do | ||
it 'should return a json representation of the object as a ruby hash' do | ||
expect(subject.as_json).to eq JSON.parse(subject.to_json) | ||
describe "#{described_class}.as_json" do | ||
it 'should return a json representation of the object as a ruby hash' do | ||
obj = described_class.new(fixed_values) | ||
expect(obj.as_json).to eq JSON.parse(obj.to_json) | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
describe IIIF::Presentation::Annotation do | ||
|
||
let(:fixed_values) { {} } | ||
|
||
describe "#{described_class}.define_methods_for_abstract_resource_only_keys" do | ||
it_behaves_like 'it has the appropriate methods for abstract_resource_only_keys' | ||
end | ||
|
||
describe "#{described_class}.as_json" do | ||
it_behaves_like 'it has symmetric as_json and to_json methods' | ||
end | ||
it_behaves_like 'it has symmetric as_json and to_json methods' | ||
end |
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
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
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 |
---|---|---|
|
@@ -38,6 +38,7 @@ | |
describe '#validate' do | ||
end | ||
|
||
it_behaves_like 'it has symmetric as_json and to_json methods' | ||
end | ||
|
||
|
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 |
---|---|---|
|
@@ -105,6 +105,7 @@ def initialize(hsh={}) | |
end | ||
end | ||
|
||
|
||
it_behaves_like 'it has symmetric as_json and to_json methods' | ||
|
||
end | ||
|
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