I want to test my executable shell script with the help of cucumber/aruba. For that purpose I created one shell script and place it in usr/local/bin/ so it can accessible from anywhere.
shell script :
arg=$1
if [ [ $arg = 1 ] ]
then
echo $(date)
fi
Now I want to test this shell script in cucumber/aruba. For that purpose I created one project structure.
aruba -
.
├── features
│ ├── support
│ │ └── env.rb
│ └── use_aruba_cucumber.feature
├── Gemfile
Gemfile -
source 'https://rubygems.org'
gem 'aruba', '~> 0.14.2'
env.rb -
require 'aruba/cucumber'
use_aruba_cucumber.feature -
Feature: Cucumber
Scenario: First Run
When I run `bash abc_qa.sh`
Then the output should contain exactly $(date)
Shell script code is returning date. Now In this feature file I want to check is that date is correct or not by using simple checking.
example : date is returning like this :
Sat Nov 5 15:00:13 IST 2016
so I just want to check Sat is right or wrong. For that purpose use one label [Mon,Tue,Wed,Thu,Fri,Sat,Sun] like this.
If Sat is available in above label Then make this test case as a pass.
note - I'm saying this label thing for simplicity sakel. If any other option for checking day is correct in seven days of week then this should be appreciated.
Thanks.