Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Faker::Computer #1948

Merged
merged 15 commits into from
May 17, 2020
Merged

Add Faker::Computer #1948

merged 15 commits into from
May 17, 2020

Conversation

cmcramer
Copy link

Issue# none

No-Story

Description:

Faker to generate data for computer types, platforms and OS. Used to populate host data.

Note:

All spec tests failed until test_helper.rb:

`require 'test/support/assert_not_english'`

changed to
require_relative 'support/assert_not_english'

- openSUSE Leap 15.1
- Ubuntu Desktop 18.04
- Ubuntu Desktop 19.10
os_x:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this should be named macOS like the value on platform?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks. That is changed.

#
# @faker.version next
def search_format(key)
key.split.length > 1 ? key.split.join('_').downcase : key.downcase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the .split.join is no longer required since the OS X is not present anymore

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed code to handle platforms with spaces

@Zeragamba Zeragamba merged commit c491e64 into faker-ruby:master May 17, 2020
@koic
Copy link
Member

koic commented May 17, 2020

@Zeragamba If a PR contains work-in-progress commits, could you like to merge it into master branch by either:

  • Ask a pull requester to squash commits for each change reason for each reason the PR aims to change
  • Use squash merge

First of all, thank you for your OSS activities 😃

koic added a commit to koic/faker that referenced this pull request May 17, 2020
Follow up to faker-ruby#1948.

This PR fixes the following error for `Faker::Computer.os`.

```console
% cd path/to/faker-ruby/faker
% bundle exec ruby -Itest test/test_determinism.rb
Loaded suite test/test_determinism
(snip)

test/test_determinism.rb:13:in `test_determinism'
test/test_determinism.rb:13:in `each_index'
     11:   def test_determinism
     12:     Faker::Config.random = Random.new(42)
     13:     @all_methods.each_index do |index|
  => 14:       store_result @all_methods[index]
     15:     end
     16:
     17:     @first_run.freeze
test/test_determinism.rb:14:in `block in test_determinism'
test/test_determinism.rb:34:in `store_result'
test/test_determinism.rb:37:in `rescue in store_result'
Error: test_determinism(TestDeterminism): RuntimeError:
Faker::Computer.os raised "missing keyword: :platform"
```
koic added a commit to koic/faker that referenced this pull request May 17, 2020
Follow up to faker-ruby#1948.

This PR fixes the following error for `Faker::Computer.os`.

```console
% cd path/to/faker-ruby/faker
% bundle exec ruby -Itest test/test_determinism.rb
Loaded suite test/test_determinism
(snip)

test/test_determinism.rb:13:in `test_determinism'
test/test_determinism.rb:13:in `each_index'
     11:   def test_determinism
     12:     Faker::Config.random = Random.new(42)
     13:     @all_methods.each_index do |index|
  => 14:       store_result @all_methods[index]
     15:     end
     16:
     17:     @first_run.freeze
test/test_determinism.rb:14:in `block in test_determinism'
test/test_determinism.rb:34:in `store_result'
test/test_determinism.rb:37:in `rescue in store_result'
Error: test_determinism(TestDeterminism): RuntimeError:
Faker::Computer.os raised "missing keyword: :platform"
```
@Zeragamba
Copy link
Contributor

@koic will do :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants