|
96 | 96 | it(title) {run_expand params} |
97 | 97 | end |
98 | 98 |
|
| 99 | + context "default language" do |
| 100 | + { |
| 101 | + "base": { |
| 102 | + input: %({ |
| 103 | + "http://example/foo": "bar" |
| 104 | + }), |
| 105 | + output: %([{ |
| 106 | + "http://example/foo": [{"@value": "bar", "@language": "en"}] |
| 107 | + }]), |
| 108 | + language: "en" |
| 109 | + }, |
| 110 | + "override": { |
| 111 | + input: %({ |
| 112 | + "@context": {"@language": null}, |
| 113 | + "http://example/foo": "bar" |
| 114 | + }), |
| 115 | + output: %([{ |
| 116 | + "http://example/foo": [{"@value": "bar"}] |
| 117 | + }]), |
| 118 | + language: "en" |
| 119 | + } |
| 120 | + }.each_pair do |title, params| |
| 121 | + it(title) {run_expand params} |
| 122 | + end |
| 123 | + end |
| 124 | + |
99 | 125 | context "with relative IRIs" do |
100 | 126 | { |
101 | 127 | "base": { |
|
2349 | 2375 | end |
2350 | 2376 |
|
2351 | 2377 | def run_expand(params) |
2352 | | - input, output, processingMode = params[:input], params[:output], params[:processingMode] |
| 2378 | + input, output = params[:input], params[:output] |
2353 | 2379 | input = ::JSON.parse(input) if input.is_a?(String) |
2354 | 2380 | output = ::JSON.parse(output) if output.is_a?(String) |
2355 | 2381 | pending params.fetch(:pending, "test implementation") unless input |
2356 | 2382 | if params[:exception] |
2357 | | - expect {JSON::LD::API.expand(input, {processingMode: processingMode}.merge(params))}.to raise_error(params[:exception]) |
| 2383 | + expect {JSON::LD::API.expand(input, params)}.to raise_error(params[:exception]) |
2358 | 2384 | else |
2359 | | - jld = JSON::LD::API.expand(input, base: params[:base], logger: logger, processingMode: processingMode) |
| 2385 | + jld = JSON::LD::API.expand(input, {logger: logger}.merge(params)) |
2360 | 2386 | expect(jld).to produce(output, logger) |
2361 | 2387 | end |
2362 | 2388 | end |
|
0 commit comments