Last active
October 8, 2016 13:39
-
-
Save tamoot/150810e3a5c40ec840a52bf9e23bae82 to your computer and use it in GitHub Desktop.
schtasksコマンド用serverspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
source "https://rubygems.org" | |
gem "serverspec", "2.36.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code:utf-8 | |
require 'spec_helper' | |
# schtasksコマンド出力に対応したエンコーディングに | |
schedule_type = "スケジュールの種類".encode("Windows-31J") | |
logon = "ログオン時".encode("Windows-31J") | |
task = "実行するタスク".encode("Windows-31J") | |
# | |
# ログイン時にctl-capsを入替えるスケジューラの確認 | |
# | |
context "Scheduler registration for yamy.exe" do | |
describe command("schtasks /query /v /fo list /tn yamy") do | |
its(:exit_status) { should eq 0 } | |
#実行するタスク | |
its(:stdout) do | |
should match /^#{task}: +Z:\\App\\yamy-0.03\\yamy.exe/ | |
end | |
#スケジュールの種類 | |
its(:stdout) do | |
should match /^#{schedule_type}: +#{logon}/ | |
end | |
#実行ユーザー | |
its(:stdout) do | |
should match /^#{run_as_user}: +tamoot/ | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment