Sha256: 4fe342f099dcd8be0be2dbd288dda4d02925a88b791e5798304de5e7e1bbdd7d

Contents?: true

Size: 737 Bytes

Versions: 2

Compression:

Stored size: 737 Bytes

Contents

#!/usr/bin/env rspec

require 'spec_helper'

require 'noms/command/urinion/data'

describe NOMS::Command::URInion::Data do
    describe '.parse' do
        context 'when parsing JSON' do
            subject(:url) { NOMS::Command::URInion::Data.parse('data:application/json;charset=UTF-8,{"one":1}') }
            specify { expect(url.host).to be_nil }
            specify { expect(url.scheme).to eq 'data' }
            specify { expect(url.path).to be_nil }
            specify { expect(url.data_encoding).to be_nil }
            specify { expect(url.mime_type).to eq 'application/json' }
            specify { expect(url.character_set).to eq 'UTF-8' }
            specify { expect(url.data).to eq '{"one":1}' }
        end
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
noms-command-2.1.1 spec/06urinion_data.rb
noms-command-0.5.0 spec/06urinion_data.rb