class Object
Constants
- SIDEKIQ_BATCH_CALLBACK_PATTERN
- SIDEKIQ_BATCH_DATA_PATTERN
- SIDEKIQ_BATCH_JOBS_PATTERN
- SIDEKIQ_LIMITER_DATA_PATTERN
- SIDEKIQ_LIMITER_JOBS_PATTERN
Public Instance Methods
base64_digit_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 11 def base64_digit_regex %r{[a-z0-9\+/=]}i end
encrypted_json_web_token_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 50 def encrypted_json_web_token_regex / (#{json_web_token_base64_regex}+?\.){4} #{json_web_token_base64_regex}+? /x end
factory_name()
click to toggle source
# File lib/rspeckled/helpers/factories.rb, line 3 def factory_name described_class.name.underscore end
fixture_filepath(filepath)
click to toggle source
# File lib/rspeckled/helpers/filepaths.rb, line 13 def fixture_filepath(filepath) "#{root_filepath}/spec/fixtures/#{filepath}" end
guid_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 19 def guid_regex /[a-f0-9]{32}/i end
hex_digit_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 15 def hex_digit_regex /[a-f0-9]/i end
iso8601_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 7 def iso8601_regex /(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.[0-9]+)?((?:[\+\-]\d{2}:\d{2})|Z)?/ end
json_response()
click to toggle source
# File lib/rspeckled/helpers/responses.rb, line 3 def json_response JSON.load(response.body) # rubocop:disable Security/JSONLoad end
json_web_token_base64_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 39 def json_web_token_base64_regex %r{[A-Za-z0-9_/\+\=\-]} end
json_web_token_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 43 def json_web_token_regex / (#{json_web_token_base64_regex}+?\.){2} #{json_web_token_base64_regex}+? /x end
md5_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 23 def md5_regex /[a-f0-9]{32}/i end
null_described_class()
click to toggle source
# File lib/rspeckled/helpers/null_objects.rb, line 3 def null_described_class "Null#{described_class.name}".constantize end
parse_fixture(filepath)
click to toggle source
# File lib/rspeckled/helpers/filepaths.rb, line 21 def parse_fixture(filepath) contents = read_fixture(filepath) case filepath[/\.\w+\z/] when '.json' ::JSON.parse(contents) when '.eml' ::Mail.new(contents) else fail ArgumentError, "I don't know how to parse #{filepath}." end end
read_fixture(filepath)
click to toggle source
# File lib/rspeckled/helpers/filepaths.rb, line 17 def read_fixture(filepath) ::File.read(fixture_filepath(filepath)) end
root_filepath()
click to toggle source
# File lib/rspeckled/helpers/filepaths.rb, line 3 def root_filepath @root_filepath ||= begin current_directory = Dir.pwd current_directory += '/..' until Dir.exist?(current_directory + '/spec') File.expand_path(current_directory) end end
sha_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 27 def sha_regex /[a-f0-9]{64}/i end
test_email_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 31 def test_email_regex /user\d+@example.com/ end
test_username_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 35 def test_username_regex /username\d+/ end
uuid_regex()
click to toggle source
# File lib/rspeckled/helpers/patterns.rb, line 3 def uuid_regex /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i end