Class: Cistern::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/cistern/mock.rb

Class Method Summary collapse

Class Method Details

.not_implemented(method = '') ⇒ Object



5
6
7
# File 'lib/cistern/mock.rb', line 5

def self.not_implemented(method = '')
  fail NotImplementedError, method ? "The call '#{method}' is not implemented" : ''
end

.random_hex(length) ⇒ Object



9
10
11
# File 'lib/cistern/mock.rb', line 9

def self.random_hex(length)
  rand(('f' * length).to_i(16)).to_s(16).rjust(length, '0')
end

.random_numbers(length) ⇒ Object



13
14
15
# File 'lib/cistern/mock.rb', line 13

def self.random_numbers(length)
  rand(('9' * length).to_i).to_s
end