-
Notifications
You must be signed in to change notification settings - Fork 8
Fix typos in README usage section #8
Comments
This would be a great first issue as well!! |
Closing the issue since it was fixed here. @rvictorino |
@K-Sato1995 both missing «r» have been fixed by the linked PR (#10 ). However, executing : SpellGenerator::Generator.new.self_generate('Random' 'Fire') Outputs I'm not a Ruby dev, so I may be missing some key point or syntactic sugar but adding a comma between both strings seems to help 😄 I guess, since this issues has been partially fixed, it would be logical to reopen it but maybe you would prefer that I open a new one focusing on the comma thing ? |
@rvictorino # This method is expecting to get 2 arguments when it's called.
def test(a,b)
p "#{a} and #{b}"
end
test('string1', 'string2') #=> "string1 and string2" # Got 2 arguments as expected.
test('string1' 'string2') #=> wrong number of arguments (given 1, expected 2) # Ruby treat it as if only one string was passed. That said, it is wired it didn't raise any error and output I just created You can run the code by following the steps below in your terminal.
|
Hi, it's me, again ! yeah, I knew I saw something about checking number of arguments in the source code; that's what bugged me. I can reproduce ! When I remove the comma, I get To sum things up, here are the code / outputs pairs I tested: SpellGenerator::Generator.new.self_generate('Random', 'Fire') #=> Random Fire
SpellGenerator::Generator.new.self_generate('RandomFire') #=> RandomFire
SpellGenerator::Generator.new.self_generate('Random' 'Fire') #=> RandomFire
So two things:
Thanks again for those great explanations about ruby @K-Sato1995 !! 🤓 😃 |
Hi @rvictorino !
Yes for sure! The part about
Originally the expected behavior is to raise the original Thanks again!!! I truly appreciate your cooperation🥇! |
Fixing this does not require to write code (but requires to execute it to validate solution !)
The text was updated successfully, but these errors were encountered: