lib/fakeit/openapi/example/string_example.rb in fakeit-0.10.0 vs lib/fakeit/openapi/example/string_example.rb in fakeit-0.11.0

- old
+ new

@@ -42,11 +42,12 @@ fixed_faker do if enum then enum.to_a.first elsif pattern then static_string_pattern elsif format then static_string_format elsif length_constraint then static_string_with_length - else 'string' + else + 'string' end end end def fixed_faker(&block) @@ -59,11 +60,12 @@ def random_string_example if enum then enum.to_a.sample elsif pattern then random_string_pattern elsif format then random_string_format elsif length_constraint then string_with_length - else Faker::Book.title + else + Faker::Book.title end end def static_string_with_length = '1' * max_string_length @@ -79,10 +81,10 @@ def string_with_length = Faker::Internet.username(specifier: min_string_length..max_string_length) def min_string_length = minLength || 0 - def max_string_length = maxLength || min_string_length + 10 + def max_string_length = maxLength || (min_string_length + 10) def random_string_format = (RANDOM_FORMAT_HANDLERS[format] || method(:unknown_format))[] def random_string_pattern = @random_string_pattern ||= @string_pattern.random_example(max_repeater_variance: 1)