Sha256: dd6b52c2fc2db6a773fbedbc4409fc3c5510bc9d16ec0cf06f2bfa88183d5ba3
Contents?: true
Size: 1.04 KB
Versions: 7
Compression:
Stored size: 1.04 KB
Contents
RSpec.describe Evil::Client::DSL::Files do subject do described_class.new(&block).call file: "Hi!", charset: "utf-16", type: "application/json", filename: "greetings.json", text: "Hoorah!" end context "from block without definitions:" do let(:block) { proc {} } it "provides an empty schema" do expect(subject).to eq([]) end end context "from block with definitions:" do let(:block) do proc do |file:, **opts| add file, **opts end end it "provides a schema" do expect(subject).to be_a Array expect(subject.count).to eq 1 item = subject.first expect(item[:file]).to be_a StringIO expect(item[:file].read).to eq "Hi!" expect(item[:type]).to eq MIME::Types["application/json"].first expect(item[:charset]).to eq "utf-16" expect(item[:filename]).to eq "greetings.json" end end end
Version data entries
7 entries across 7 versions & 1 rubygems