Sha256: 2a55fa47deef09e48dd6eaf6fb6c3ad51990c8e75d197672a035807412760f50
Contents?: true
Size: 1.35 KB
Versions: 7
Compression:
Stored size: 1.35 KB
Contents
require "spec_helper" require "ribose/resource_helper" RSpec.describe "TestResourceHelper" do describe "helpers" do context "without any customization" do it "builds and returns the default values" do resource = Ribose::TestResourceHelper.new expect(resource.resource).to eq("resource") expect(resource.resources).to eq("resources") expect(resource.resources_path).to eq("resources") expect(resource.resource_path).to eq("resources/123456789") end context "with customization" do it "returns the custom values when available" do custom_resource = Ribose::CustomResourceHelper.new expect(custom_resource.resources).to eq("resources") expect(custom_resource.resources_path).to eq("resource/nested") expect(custom_resource.resource_path).to eq("custom/nested/123456789") end end end end module Ribose class TestResourceHelper include Ribose::ResourceHelper def resource "resource" end def resource_id 123_456_789 end end class CustomResourceHelper include Ribose::ResourceHelper def resource "resource" end def resources_path "resource/nested" end def resource_path "custom/nested/123456789" end end end end
Version data entries
7 entries across 7 versions & 1 rubygems