summaryrefslogtreecommitdiff
path: root/spec/support/shared/shared_examples.rb
blob: 0c031bbafd9e5abeee12efaf61e05c0922c4a9f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# For storing any examples shared between multiple tests

# Any object which defines a .to_json should import this test
shared_examples "to_json equivalent to Chef::JSONCompat.to_json" do

  let(:jsonable) do
    raise "You must define the subject when including this test"
  end

  it "should allow consumers to call #to_json or Chef::JSONCompat.to_json" do
    expect(jsonable.to_json).to eq(Chef::JSONCompat.to_json(jsonable))
  end

end