Skip to content

Commit

Permalink
Adding test scenarios for displaying exported variables
Browse files Browse the repository at this point in the history
This commit includes two file updates for testing the new feature
as requested in jamesob#56. The example hello deskfile now has
a variable set called MyName with a value "James" and the runtests
shell script includes a test to echo the value of that variable.

This test proves that the variable is exported as expected from the
deskfile and is retrievable as expected.

Still #todo includes a test that lists the description of the deskfile
and looks for that variable to be listed along with the aliases and
functions.
  • Loading branch information
cfont committed Mar 15, 2016
1 parent 5dba5cf commit 0e364e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/hello.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ hi() {
# Use if you're from Texas.
alias howdy="echo howdy y\'all"

# Why should I always type my name
export MyName="James"

4 changes: 4 additions & 0 deletions test/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ RAN=$(desk run hello 'hi j')
echo "$RAN" | grep 'hi, j!' >/dev/null
ensure $? "Run in desk 'hello' didn't work with hi function"

RAN=$(desk run hello 'echo $MyName')
echo "$RAN" | grep 'James' >/dev/null
ensure $? "Run in desk 'hello' didn't work with MyName exported variable"

## `desk go`

RAN=$(desk go example-project/Deskfile -c 'desk ; exit')
Expand Down

0 comments on commit 0e364e8

Please sign in to comment.