Sha256: a4016325a81a6d9bca1049eef1047f75b619f83a00cee1bf9971342eb97b3b2c
Contents?: true
Size: 1.13 KB
Versions: 6
Compression:
Stored size: 1.13 KB
Contents
require 'spec_helper' RSpec.describe NgrokAPI::Models::IPPolicy do before(:each) do @client = class_double("IPPolicysClient") @ip_policy = NgrokAPI::Models::IPPolicy.new(client: @client, result: ip_policy_result) end describe "#==" do it "is equal if the results are the same" do other = NgrokAPI::Models::IPPolicy.new(client: @client, result: ip_policy_result) expect(@ip_policy == other).to eq true end end describe "#to_s" do it "stringifies as result.to_s" do expect(@ip_policy.to_s).to eq ip_policy_result.to_s end end describe "#delete" do it "calls delete on the client" do expect(@ip_policy.client).to receive(:delete) @ip_policy.delete end end describe "#update" do it "calls update on the client" do new_description = 'New description' new_metadata = 'New metadata' expect(@ip_policy.client).to receive(:update) @ip_policy.update( description: new_description, metadata: new_metadata ) expect(@ip_policy.description).to eq new_description expect(@ip_policy.metadata).to eq new_metadata end end end
Version data entries
6 entries across 6 versions & 1 rubygems