tests/testthat/test_get_command.R

context("get_command")

describe("get_command", {
    source("helper.R")

    it("filename provided", {
        command_struct <- scriptexec::get_command("myfile.sh")

        runner <- get_os_string("sh", "cmd.exe")
        expect_equal(runner, command_struct$command)
    })

    it("runner provided", {
        command_struct <- scriptexec::get_command("myfile.sh", "bash")

        expect_equal("bash", command_struct$command)
    })
})

Try the scriptexec package in your browser

Any scripts or data that you put into this service are public.

scriptexec documentation built on May 2, 2019, 1:49 p.m.