Sha256: d2a341988ac29b2ba70e03858fff44ca9340dee941ac59df8143e43d9e4149d1
Contents?: true
Size: 1.63 KB
Versions: 45
Compression:
Stored size: 1.63 KB
Contents
RSpec.describe HTTP::ContentType do describe ".parse" do context "with text/plain" do subject { described_class.parse "text/plain" } its(:mime_type) { is_expected.to eq "text/plain" } its(:charset) { is_expected.to be_nil } end context "with tEXT/plaIN" do subject { described_class.parse "tEXT/plaIN" } its(:mime_type) { is_expected.to eq "text/plain" } its(:charset) { is_expected.to be_nil } end context "with text/plain; charset=utf-8" do subject { described_class.parse "text/plain; charset=utf-8" } its(:mime_type) { is_expected.to eq "text/plain" } its(:charset) { is_expected.to eq "utf-8" } end context 'with text/plain; charset="utf-8"' do subject { described_class.parse 'text/plain; charset="utf-8"' } its(:mime_type) { is_expected.to eq "text/plain" } its(:charset) { is_expected.to eq "utf-8" } end context "with text/plain; charSET=utf-8" do subject { described_class.parse "text/plain; charSET=utf-8" } its(:mime_type) { is_expected.to eq "text/plain" } its(:charset) { is_expected.to eq "utf-8" } end context "with text/plain; foo=bar; charset=utf-8" do subject { described_class.parse "text/plain; foo=bar; charset=utf-8" } its(:mime_type) { is_expected.to eq "text/plain" } its(:charset) { is_expected.to eq "utf-8" } end context "with text/plain;charset=utf-8;foo=bar" do subject { described_class.parse "text/plain;charset=utf-8;foo=bar" } its(:mime_type) { is_expected.to eq "text/plain" } its(:charset) { is_expected.to eq "utf-8" } end end end
Version data entries
45 entries across 45 versions & 1 rubygems