We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Faker::Json.shallow_json raises an error when using the future proof # frozen_string_literal: true magic.
# frozen_string_literal: true
Test File:
∴ cat frozen_faker.rb # frozen_string_literal: true require 'faker' puts Faker::Json.shallow_json(2, key: 'RockBand.name', value: 'Seinfeld.quote')
Run:
∴ ruby frozen_faker.rb Traceback (most recent call last): 2: from frozen_faker.rb:5:in `<main>' 1: from /Users/karuna/.rvm/gems/ruby-2.6.0/gems/faker-1.9.3/lib/faker/default/json.rb:7:in `shallow_json' /Users/karuna/.rvm/gems/ruby-2.6.0/gems/faker-1.9.3/lib/faker/default/json.rb:7:in `prepend': can't modify frozen String (FrozenError)
Faker::Json.shallow_json should return a string.
Faker::Json.shallow_json
The example code was lifted from faker docs here: https://github.com/stympy/faker/blob/master/doc/default/json.md
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
Faker::Json.shallow_json raises an error when using the future proof
# frozen_string_literal: true
magic.To Reproduce
Test File:
Run:
Expected behavior
Faker::Json.shallow_json
should return a string.Additional context
The example code was lifted from faker docs here:
https://github.com/stympy/faker/blob/master/doc/default/json.md
The text was updated successfully, but these errors were encountered: