Sha256: 044af5f450066fc139308ca3726f359602564aca70f83a5e6956238dc84b9398
Contents?: true
Size: 654 Bytes
Versions: 12
Compression:
Stored size: 654 Bytes
Contents
RSpec.describe Evil::Client::Formatter::Form do subject { described_class.call value } context "when value is a hash" do let(:value) { { foo: { bar: [baz: :qux], qux: [1, 2] } } } it "returns formatted string" do expect(subject).to eq "foo[bar][][baz]=qux&foo[qux][]=1&foo[qux][]=2" end end context "when value is nil" do let(:value) { nil } it "returns nil" do expect(subject).to be_nil end end context "when value is not a hash" do let(:value) { 844 } it "raises Evil::Client::DefinitionError" do expect { subject }.to raise_error StandardError, "844 is not a hash" end end end
Version data entries
12 entries across 12 versions & 1 rubygems