RSpec Example

First Step for creating RSpec.

require 'rspec/autorun'
describe Order do
  # ...
end

Describe the block used to group all test cases and specify which class is testing.

Next, it block is a test case name that was written in describe block.

describe Order do
  it "does something" do
    # ...
  end
end

Test case Example

describe Sum do
  it "Sum of two numbers" do
    sum = Sum.new
    expected(sum.add(10,10)).to eq(10)
  end
end

Before creating the above test case you need to create Sum class and add method with two arguments.

https://www.learningcontainer.com/convert-object-to-hash-ruby/
Convert Object to hash