Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.travis.yml
Gemfile
README.md
Rakefile
elibri_onix_mocks.gemspec

README.md

Build Status

Gem created for Mocking eLibri xml objects. More info coming soon.

Basic usage: Elibri::XmlMocks::Example.basic_product

methods to create mock objects: basic_product book_example onix_record_identifiers_example onix_product_form_example onix_epub_details_example onix_categories_example onix_languages_example onix_measurement_example onix_sale_restrictions_example onix_audience_range_example onix_publisher_info_example onix_subjects_example onix_edition_example onix_ebook_extent_example onix_audiobook_extent_example onix_no_contributors_example onix_collective_work_example onix_contributors_example onix_announced_product_example onix_preorder_product_example onix_published_product_example onix_out_of_print_product_example onix_titles_example onix_title_with_collection_example onix_texts_example onix_related_products_example onix_supply_details_example onix_series_memberships_example onix_supporting_resources_example onix_elibri_extensions_example contributor_mock review_mock supply_detail_mock imprint_mock description_mock

Each method take arguments in a hash form, where key is the name of attribute in mock object. Value can be string, array, another mock object - depend on situation.

For list of important attributes please look into lib/mocks/xml_mocks.rb file.

If you want to create eLibri xml from mock: Elibri::ONIX::XMLGenerator.new(mock_object).to_s

Creating product from xml: Elibri::ONIX::Release_3_0::ONIXMessage.from_xml(xml_string)

Therefore you can use it to test your api handling function - you will receive same xml from mock, as you will receive from actual elibri api (with different data ofc :))

Something went wrong with that request. Please try again.