test/unit/db_tests.rb in dumpdb-2.0.0 vs test/unit/db_tests.rb in dumpdb-2.1.0
- old
+ new
@@ -39,11 +39,11 @@
:db => @db_name,
:output_root => @output_root,
:custom_value => @custom_value
})
end
- subject { @db }
+ subject{ @db }
should have_imeths :host, :port, :user, :pw, :db
should have_imeths :output_root, :output_dir, :dump_file
should have_imeths :to_hash
@@ -52,12 +52,14 @@
assert_equal @port, subject.port
assert_equal @user, subject.user
assert_equal @pw, subject.pw
assert_equal @db_name, subject.db
assert_equal @output_root, subject.output_root
+
exp = File.join(@output_root, "#{@host}__#{@db_name}__#{@current_time.to_f}")
assert_equal exp, subject.output_dir
+
exp = File.join(subject.output_dir, @dump_file_name)
assert_equal exp, subject.dump_file
end
should "allow custom attributes" do
@@ -73,9 +75,10 @@
assert_equal DEFAULT_VALUE, db.user
assert_equal DEFAULT_VALUE, db.pw
assert_equal DEFAULT_VALUE, db.db
assert_equal DEFAULT_VALUE, db.output_root
assert_equal @current_time.to_f.to_s, db.output_dir
+
exp = File.join(db.output_dir, 'dump.output')
assert_equal exp, db.dump_file
end
end