Class: GorgonBunny::TestKit
- Inherits:
-
Object
- Object
- GorgonBunny::TestKit
- Defined in:
- lib/gorgon_bunny/lib/gorgon_bunny/test_kit.rb
Overview
Unit, integration and stress testing toolkit
Class Method Summary collapse
-
.message_in_kb(a, b, i) ⇒ String
Message payload of length in the given range, with non-ASCII characters.
-
.random_in_range(a, b) ⇒ Integer
private
Random integer in the range of [a, b].
Class Method Details
.message_in_kb(a, b, i) ⇒ String
Returns Message payload of length in the given range, with non-ASCII characters.
18 19 20 21 22 23 |
# File 'lib/gorgon_bunny/lib/gorgon_bunny/test_kit.rb', line 18 def (a, b, i) s = "Ю#{i}" n = random_in_range(a, b) / s.bytesize s * n * 1024 end |
.random_in_range(a, b) ⇒ Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns Random integer in the range of [a, b].
9 10 11 |
# File 'lib/gorgon_bunny/lib/gorgon_bunny/test_kit.rb', line 9 def random_in_range(a, b) Range.new(a, b).to_a.sample end |