1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-10-30 11:54:01 -04:00

Ruby: reorder specs

This commit is contained in:
Alex Kotov 2022-05-23 21:18:11 +03:00
parent bdc80917b4
commit c20ad6bace
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -6,6 +6,27 @@ RSpec.describe KernAux, '.snprintf1' do
if described_class.singleton_class.method_defined? :snprintf1
let(:size) { 10_000 }
context 'with 0 arguments' do
specify do
expect { described_class.snprintf1 }.to \
raise_error ArgumentError, 'expected 2, 3 or 4 args'
end
end
context 'with 1 argument' do
specify do
expect { described_class.snprintf1 size }.to \
raise_error ArgumentError, 'expected 2, 3 or 4 args'
end
end
context 'with 5 arguments' do
specify do
expect { described_class.snprintf1 size, '%*s', 20, 'foo', 'bar' }.to \
raise_error ArgumentError, 'expected 2, 3 or 4 args'
end
end
context 'with 2 arguments' do
subject(:snprintf1) { described_class.snprintf1 size, format }
@ -185,26 +206,5 @@ RSpec.describe KernAux, '.snprintf1' do
end
end
end
context 'with 0 arguments' do
specify do
expect { described_class.snprintf1 }.to \
raise_error ArgumentError, 'expected 2, 3 or 4 args'
end
end
context 'with 1 argument' do
specify do
expect { described_class.snprintf1 size }.to \
raise_error ArgumentError, 'expected 2, 3 or 4 args'
end
end
context 'with 5 arguments' do
specify do
expect { described_class.snprintf1 size, '%*s', 20, 'foo', 'bar' }.to \
raise_error ArgumentError, 'expected 2, 3 or 4 args'
end
end
end
end