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:
parent
bdc80917b4
commit
c20ad6bace
1 changed files with 21 additions and 21 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue