The modern Ruby QuickBooks client Part 2

This article is over 2 years old. Proceed with caution.

Regards ♨ – Minimul

"Real world" fixtures

The qbo_api gem's specs were built against an official QuickBooks sandbox and
then recorded using the VCR gem. Therefore, you have a fantastically quick way to get
started with your integration project in that you can see "real world" QBO API transaction without your own sandbox or even a network connection. Allow me to demonstrate.

Clone the qbo_api gem, switch into the new directory, and bundle

$ git clone git://github.com/minimul/qbo_api && cd qbo_api
$ bundle

Create a .env file
If you are just running the specs then at minimum your .env needs to look like the following:

Let's get some green before we dive in further.
Note: the be is a bash alias for bundle exec.

Let's open up the spec/create_update_delete_spec.rb

Then go to the first spec where abouts the VCR cassette is being recorded.

Here you see how the gem is initialized.

The creds method is defined in the
spec/spec_helper.rb

The .env file is loaded by the
Dotenv gem.

Minimul says —

If you want to see an example of an advanced VCR custom matcher keep
reading the spec/spec_helper.rb file. The purpose of the
matcher is to make VCR more lenient so that any QuickBooks sandbox can be used.