DEV Community

Cover image for Exercism Ruby - Hello World
Juan Vasquez
Juan Vasquez

Posted on • Edited on

Exercism Ruby - Hello World

Alt Text

The classical introductory exercise. Just say "Hello, World!".

"Hello, World!" is the traditional first program for beginning programming in a new language or environment.

The objectives are simple:

  • Write a function that returns the string "Hello, World!".

  • Run the test suite and make sure that it succeeds.

  • Submit your solution and check it at the website.

# Common test data version: 1.1.0 be3ae66
class HelloWorldTest < Minitest::Test
  def test_say_hi
    assert_equal "Hello, World!", HelloWorld.hello
  end
end
Enter fullscreen mode Exit fullscreen mode

My solution is:

class HelloWorld
  def self.hello
    "Hello, World!"
  end
end
Enter fullscreen mode Exit fullscreen mode

I know this time was pretty simple, see you next time!

I'm doing a youtube series about these exercises if you want to follow me, you are welcome, this is the channel juanvqz and this is the exercism playlist

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay