mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
Rename file
This commit is contained in:
@@ -11,8 +11,8 @@ require "dfc_provider/supplied_product"
|
||||
require "dfc_provider/address"
|
||||
require "dfc_provider/coordination"
|
||||
|
||||
# 🙈
|
||||
require "inspect"
|
||||
# 🙈 Monkey-patch a better inspector for semantic objects
|
||||
require "semantic_object_inspect"
|
||||
|
||||
module DfcProvider
|
||||
DataFoodConsortium::Connector::Importer.register_type(SuppliedProduct)
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "../spec_helper"
|
||||
|
||||
RSpec.describe "#pretty_inspect" do
|
||||
it "provides a clean output for Address" do
|
||||
subject = DataFoodConsortium::Connector::Address.new("some/id")
|
||||
|
||||
expect(subject.pretty_inspect).to match <<~HEREDOC
|
||||
#<DataFoodConsortium::Connector::Address:.*
|
||||
@semanticId="some/id",
|
||||
@semanticType="dfc-b:Address",
|
||||
@street=nil,
|
||||
@postalCode=nil,
|
||||
@city=nil,
|
||||
@country=nil,
|
||||
@latitude=nil,
|
||||
@longitude=nil,
|
||||
@region=nil>
|
||||
HEREDOC
|
||||
end
|
||||
|
||||
it "provides a clean output for OrderLine" do
|
||||
subject = DataFoodConsortium::Connector::OrderLine.new("some/id")
|
||||
|
||||
expect(subject.pretty_inspect).to match <<~HEREDOC
|
||||
#<DataFoodConsortium::Connector::OrderLine:.*
|
||||
@semanticId="some/id",
|
||||
@semanticType="dfc-b:OrderLine",
|
||||
@description=nil,
|
||||
@quantity=nil,
|
||||
@price=nil,
|
||||
@offer=nil,
|
||||
@order=nil>
|
||||
HEREDOC
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,39 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "../spec_helper"
|
||||
|
||||
RSpec.describe VirtualAssembly::Semantizer::SemanticObject do
|
||||
describe "#pretty_inspect" do
|
||||
it "provides a clean output for Address" do
|
||||
subject = DataFoodConsortium::Connector::Address.new("some/id")
|
||||
|
||||
expect(subject.pretty_inspect).to match <<~HEREDOC
|
||||
#<DataFoodConsortium::Connector::Address:.*
|
||||
@semanticId="some/id",
|
||||
@semanticType="dfc-b:Address",
|
||||
@street=nil,
|
||||
@postalCode=nil,
|
||||
@city=nil,
|
||||
@country=nil,
|
||||
@latitude=nil,
|
||||
@longitude=nil,
|
||||
@region=nil>
|
||||
HEREDOC
|
||||
end
|
||||
|
||||
it "provides a clean output for OrderLine" do
|
||||
subject = DataFoodConsortium::Connector::OrderLine.new("some/id")
|
||||
|
||||
expect(subject.pretty_inspect).to match <<~HEREDOC
|
||||
#<DataFoodConsortium::Connector::OrderLine:.*
|
||||
@semanticId="some/id",
|
||||
@semanticType="dfc-b:OrderLine",
|
||||
@description=nil,
|
||||
@quantity=nil,
|
||||
@price=nil,
|
||||
@offer=nil,
|
||||
@order=nil>
|
||||
HEREDOC
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user