GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - github1/shellspec-remote

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
bin
bin
 
 
docker
docker
 
 
src
src
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
bridge.sh
bridge.sh
 
 
build.gradle
build.gradle
 
 
build.sh
build.sh
 
 
sample.json
sample.json
 
 

Repository files navigation

shellspec-remote

Install

git clone [repo-url]
ln -s ${PWD}/shellspec-remote/bin/cli.sh /usr/local/bin/shellspec-remote

Usage

shellspec-remote ./README.md

Examples

./bin/cli.sh ./README.md
# @OnHost
setup() {
  bash -c "while true; do sleep 1; done" &
  background_process_PID=$!
}
# @OnHost
cleanup() {
  if [[ -n "${background_process_PID}" ]]; then
    echo "killing ${background_process_PID}"
    kill -9 ${background_process_PID}
  else
    echo "background_process_PID not found"
  fi
}
# @OnHost
remote_var_is_set() {
  [[ -n "${!1}" ]]
}
# @OnHost
remote_uname() {
  uname -a
}
# @OnHost
remote_exit_with() {
  exit "$1"
}
# @OnHost
remote_file() {
  cat ./sample.json
}
local_pipe_from_remote() {
  remote_file | jq .
}
local_uname() {
  uname -a
}
local_exit_with() {
  return "$1"
}
Context 'shellspec-remote'
  BeforeAll 'setup'
  AfterAll 'cleanup'
  Describe 'calling a function with the @OnHost annotation'
      It 'can run remote background processes'
        Assert remote_var_is_set background_process_PID
      End
      It 'should execute on the docker host'
        When call remote_uname
        The output should match pattern "*Darwin*"
        The output should not equal "$(local_uname)"
      End
      It 'can exit with a code'
        When call remote_exit_with 3
        The status should eq 3
      End
  End
  Describe 'calling a function without the @OnHost annotation'
      It 'should execute inside the container'
        When call local_uname
        The output should match pattern "*Linux*"
      End
      It 'can exit with a code'
        When call local_exit_with 3
        The status should eq 3
      End
  End
End

License

MIT

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.