Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit 5d96801

Browse files
committed
Add test for updated rand_numeric functionality
1 parent c392722 commit 5d96801

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spec/utility/text_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@
8282
val = Wpxf::Utility::Text.rand_numeric(10)
8383
expect(val).to match(/^[0-9]{10}$/)
8484
end
85+
86+
context 'when allow_leading_zero is set to false' do
87+
it 'returns a value that does not start with zero' do
88+
1000.times do
89+
val = Wpxf::Utility::Text.rand_numeric(3, false)
90+
expect(val[0]).to_not eq '0'
91+
end
92+
end
93+
end
8594
end
8695

8796
describe '.md5' do

0 commit comments

Comments
 (0)