require 'simplecov' SimpleCov.start require 'tmpdir' require 'rbatch/variables' describe RBatch::Variables do before :all do @home = File.join(Dir.tmpdir, "rbatch_test_" + Time.now.strftime("%Y%m%d%H%M%S")) end before :each do ENV["RB_HOME"]=@home end it "default" do @vars = RBatch::Variables.new() #expect(@vars[:host_name]).to eq "" #expect(@vars[:program_name]).to eq "rspec" #expect(@vars[:program_path]).to eq "rspec" expect(@vars[:program_base]).to eq "rspec" expect(@vars[:home_dir]).to eq @home expect(@vars[:log_dir]).to eq File.join(@home,"log") expect(@vars[:conf_dir]).to eq File.join(@home,"conf") expect(@vars[:lib_dir]).to eq File.join(@home,"lib") expect(@vars[:run_conf_path]).to eq File.join(@home,".rbatchrc") expect(@vars[:config_path]).to eq File.join(@home,"conf","rspec.yaml") expect(@vars[:config_erb_path]).to eq File.join(@home,"conf","rspec.yaml.erb") expect(@vars[:common_config_path]).to eq File.join(@home,"conf","common.yaml") expect(@vars[:common_config_erb_path]).to eq File.join(@home,"conf","common.yaml.erb") expect(@vars.run_conf[:log_dir]).to eq "/log" expect(@vars.run_conf[:conf_dir]).to eq "/conf" expect(@vars.run_conf[:lib_dir]).to eq "/lib" expect(@vars.run_conf[:log_name]).to eq "_