From 1ad56481e30928032ac32b96dd161a59c915fea0 Mon Sep 17 00:00:00 2001 From: Rob Phoenix Date: Tue, 21 Feb 2017 10:39:57 +0000 Subject: [PATCH] hello-world: Change to always expect "Hello, World!" see https://github.com/exercism/x-common/pull/544 --- exercises/hello-world/example.lua | 5 ++--- exercises/hello-world/hello-world_spec.lua | 17 +++++------------ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/exercises/hello-world/example.lua b/exercises/hello-world/example.lua index 0529ddfe..801765a5 100644 --- a/exercises/hello-world/example.lua +++ b/exercises/hello-world/example.lua @@ -1,8 +1,7 @@ local hello_world = {} -function hello_world.hello( name ) - if not name or name == '' then name = 'world' end - return 'Hello, ' .. name .. '!' +function hello_world.hello() + return 'Hello, World!' end return hello_world diff --git a/exercises/hello-world/hello-world_spec.lua b/exercises/hello-world/hello-world_spec.lua index 5bca2578..d78b578c 100644 --- a/exercises/hello-world/hello-world_spec.lua +++ b/exercises/hello-world/hello-world_spec.lua @@ -1,18 +1,11 @@ local hello_world = require('hello-world') +-- Define a module named hello-world. This module should contain a single +-- function named hello that takes no arguments and returns a string. + describe('hello-world', function() - it('says hello world with no name', function() + it('says hello world', function() local result = hello_world.hello() - assert.are.equal('Hello, world!', result) - end) - - it('says hello to Bob', function() - local result = hello_world.hello('Bob') - assert.are.equal('Hello, Bob!', result) - end) - - it('says hello to Sally', function() - local result = hello_world.hello('Sally') - assert.are.equal('Hello, Sally!', result) + assert.are.equal('Hello, World!', result) end) end)