Skip to content

Commit

Permalink
Fix spaces (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogervinas authored Nov 22, 2023
1 parent e47b6f9 commit 145eb30
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions bash/src/hello-app.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function helloApp() {
local messageFn=$1
local consoleFn=$2
$consoleFn "$($messageFn)"
local messageFn=$1
local consoleFn=$2
$consoleFn "$($messageFn)"
}
4 changes: 2 additions & 2 deletions bash/src/hello-console.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function helloConsole() {
local text=$1
echo "$text"
local text=$1
echo "$text"
}
2 changes: 1 addition & 1 deletion bash/src/hello-message.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
function helloMessage() {
echo "Hello World!"
echo "Hello World!"
}
44 changes: 22 additions & 22 deletions bash/test/hello.bats
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
setup() {
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'

DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
PATH="$DIR/../src:$PATH"
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
PATH="$DIR/../src:$PATH"
}

@test "helloMessage should return hello world" {
source hello-message.bash
run helloMessage
source hello-message.bash
run helloMessage

assert_output "Hello World!"
assert_output "Hello World!"
}

@test "helloApp should print hello message" {
function helloMessageMock() {
echo "Hello Test!"
}

function helloConsoleMock() {
local text=$1
echo "helloConsoleMock[$text]"
}

source hello-app.bash
run helloApp helloMessageMock helloConsoleMock
assert_output "helloConsoleMock[Hello Test!]"
function helloMessageMock() {
echo "Hello Test!"
}

function helloConsoleMock() {
local text=$1
echo "helloConsoleMock[$text]"
}

source hello-app.bash
run helloApp helloMessageMock helloConsoleMock

assert_output "helloConsoleMock[Hello Test!]"
}

@test "hello.bash should print hello world" {
run hello.bash
run hello.bash

assert_output "Hello World!"
assert_output "Hello World!"
}

0 comments on commit 145eb30

Please sign in to comment.