File: output_env_test.rb

package info (click to toggle)
ruby-whenever 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 328 kB
  • sloc: ruby: 2,722; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 651 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'test_helper'

class OutputEnvTest < Whenever::TestCase
  setup do
    @output = Whenever.cron \
    <<-file
      env :MYVAR, 'blah'
      env 'MAILTO', "someone@example.com"
      env :BLANKVAR, ''
      env :NILVAR, nil
    file
  end

  should "output MYVAR environment variable" do
    assert_match "MYVAR=blah", @output
  end

  should "output MAILTO environment variable" do
    assert_match "MAILTO=someone@example.com", @output
  end

  should "output BLANKVAR environment variable" do
    assert_match "BLANKVAR=\"\"", @output
  end

  should "output NILVAR environment variable" do
    assert_match "NILVAR=\"\"", @output
  end
end