spec/rbatch/run_conf_spec.rb in rbatch-2.1.4 vs spec/rbatch/run_conf_spec.rb in rbatch-2.1.5
- old
+ new
@@ -7,11 +7,10 @@
describe RBatch::RunConf do
before :all do
@HOME_DIR = File.join(Dir.tmpdir, "rbatch_test_" + Time.now.strftime("%Y%m%d%H%M%S"))
Dir.mkdir(@HOME_DIR)
ENV["RB_HOME"]=@HOME_DIR
- ENV["RB_VERBOSE"]="0"
@home = ENV["RB_HOME"]
@config = File.join(@home,"run_conf_test.yaml")
end
before :each do
@@ -37,33 +36,33 @@
expect(tmp[:log_level]).to eq "info"
expect(tmp[:conf_dir]).to eq "<home>/conf"
end
it "raise when key does not exist" do
- expect{@rc[:not_exist_key]}.to raise_error(RBatch::RunConf::Exception)
+ expect{@rc[:not_exist_key]}.to raise_error(RBatch::RunConfException)
end
it "read run conf" do
open( @config , "w" ){|f| f.write("log_level: hoge")}
tmp = RBatch::RunConf.new(@config)
expect(tmp[:log_level]).to eq "hoge"
end
it "raise when run_conf has unreserved key" do
open( @config , "w" ){|f| f.write("unreserved: hoge")}
- expect{tmp = RBatch::RunConf.new(@config)}.to raise_error(RBatch::RunConf::Exception)
+ expect{tmp = RBatch::RunConf.new(@config)}.to raise_error(RBatch::RunConfException)
end
describe "[]= method" do
it "success" do
expect(@rc[:log_level]).to eq "info"
@rc[:log_level] = "hoge"
expect(@rc[:log_level]).to eq "hoge"
end
it "raise when set unreserved key" do
- expect{@rc[:unreservied] = "hoge"}.to raise_error(RBatch::RunConf::Exception)
+ expect{@rc[:unreservied] = "hoge"}.to raise_error(RBatch::RunConfException)
end
end
describe "merge! method" do
it "success" do
@@ -72,11 +71,11 @@
expect(@rc[:log_level]).to eq "error"
end
it "raise when key does not exist" do
opt={ :unreserved => "error"}
- expect{@rc.merge!(opt)}.to raise_error(RBatch::RunConf::Exception)
+ expect{@rc.merge!(opt)}.to raise_error(RBatch::RunConfException)
end
end
describe "merge method" do
it "success" do
@@ -86,9 +85,9 @@
expect(tmp[:log_level]).to eq "error"
end
it "raise when key does not exist" do
opt={ :unreserved => "error"}
- expect{@rc.merge(opt)}.to raise_error(RBatch::RunConf::Exception)
+ expect{@rc.merge(opt)}.to raise_error(RBatch::RunConfException)
end
end
end