|
778 | 778 | { |
779 | 779 | "prefix with #" => ["http://example.com/#", "http://example.com/#foo", "foo"], |
780 | 780 | "prefix with /" => ["http://example.com/", "http://example.com/#foo", "#foo"], |
781 | | - "prefix without / or #" => ["http://example.com/f", "http://example.com/foo", "http://example.com/foo"], |
| 781 | + "prefix without / or #" => ["http://example.com/f", "http://example.com/foo", "foo"], |
782 | 782 | }.each do |name, (base_uri,orig,result)| |
783 | 783 | it "<#{base_uri}> + <#{orig}>: <#{result}>" do |
784 | 784 | expect(described_class.new(orig).relativize(base_uri)).to eq result |
785 | 785 | end |
786 | 786 | end |
| 787 | + |
| 788 | + context "json-ld compact#t0066" do |
| 789 | + { |
| 790 | + "https://w3c.github.io/json-ld-api/tests/compact/link" => "link", |
| 791 | + "https://w3c.github.io/json-ld-api/tests/compact/0066-in.jsonld#fragment-works" => "#fragment-works", |
| 792 | + "https://w3c.github.io/json-ld-api/tests/compact/0066-in.jsonld?query=works" => "?query=works", |
| 793 | + "https://w3c.github.io/json-ld-api/tests/" => "../", |
| 794 | + "https://w3c.github.io/json-ld-api/" => "../../", |
| 795 | + "https://w3c.github.io/json-ld-api/parent" => "../../parent", |
| 796 | + "https://w3c.github.io/json-ld-api/parent#fragment" => "../../parent#fragment", |
| 797 | + "https://w3c.github.io/parent-parent-eq-root" => "../../../parent-parent-eq-root", |
| 798 | + "https://w3c.github.io/still-root" => "../../../still-root", |
| 799 | + "https://w3c.github.io/too-many-dots" => "../../../too-many-dots", |
| 800 | + "https://w3c.github.io/absolute" => "../../../absolute", |
| 801 | + "http://example.org/scheme-relative" => "http://example.org/scheme-relative" |
| 802 | + }.each do |orig, result| |
| 803 | + it "relativises #{orig} to #{result}" do |
| 804 | + expect(described_class.new(orig).relativize("https://w3c.github.io/json-ld-api/tests/compact/0066-in.jsonld")).to eq result |
| 805 | + end |
| 806 | + end |
| 807 | + end |
787 | 808 | end |
788 | 809 |
|
789 | 810 | describe "#request_uri" do |
|
950 | 971 | end |
951 | 972 |
|
952 | 973 | it "#=~" do |
953 | | - expect(RDF::URI('http://example.org/')).to match /example/ |
954 | | - expect(RDF::URI('http://example.org/')).not_to match /foobar/ |
| 974 | + expect(RDF::URI('http://example.org/')).to match(/example/) |
| 975 | + expect(RDF::URI('http://example.org/')).not_to match(/foobar/) |
955 | 976 | end |
956 | 977 |
|
957 | 978 | it "#to_str" do |
|
0 commit comments