Skip to content
New issue

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

Fix Faker::Source ruby language examples #1304

Merged
merged 3 commits into from
Jul 11, 2018
Merged

Fix Faker::Source ruby language examples #1304

merged 3 commits into from
Jul 11, 2018

Conversation

YumaInaura
Copy link
Contributor

@YumaInaura YumaInaura commented Jul 8, 2018

Fix 0 to 9 => 1 to 10

Ruby code

10.times do |i|
  print i
end

Output

0123456789

Ruby code

[*1..10].each { |i| puts i }

Output

1
2
3
4
5
6
7
8
9
10

Ruby print method to p method

  • print is not wrong but rubyist prefer use p or puts method
  • puts method output text and new line code on end of line

Another

  • Refactored test : not depends on just one kind programming language

Ruby code

```
10.times do |i|
  puts i
end
```

Output

```
0123456789
```

Ruby code

```
[*1..10].each { |i| p i }
```

Output

```
1
2
3
4
5
6
7
8
9
10
```
- print is not wrong but rubyist prefer use p or puts method
- p method output text and new line code on end of line

- Refactor test : not depends on one lanuage
@YumaInaura YumaInaura changed the title Fix source examples of ruby language Fix Faker::Source ruby language examples Jul 8, 2018
@vbrazo vbrazo added the Chores label Jul 9, 2018
@stympy stympy merged commit c601cc6 into faker-ruby:master Jul 11, 2018
@YumaInaura YumaInaura deleted the source_en_ruby branch July 12, 2018 04:59
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants