Ruby: add specs for method KernAux.cmdline

This commit is contained in:
Alex Kotov 2022-01-22 05:30:30 +05:00
parent b73bbc2643
commit d9dc6c38d8
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe KernAux, '.cmdline' do
subject(:cmdline) { described_class.cmdline str }
let(:str) { 'foo bar\\ baz "car cdr"' }
it { is_expected.to be_instance_of Array }
it { is_expected.to be_frozen }
it { is_expected.to all be_instance_of String }
it { is_expected.to all be_frozen }
it { is_expected.to eq ['foo', 'bar baz', 'car cdr'] }
end