test/unit/rake_task_test.rb in rails-erd-1.5.2 vs test/unit/rake_task_test.rb in rails-erd-1.6.0
- old
+ new
@@ -171,6 +171,24 @@
test "options task should set known array command line options" do
ENV["attributes"] = "content,timestamps"
Rake::Task["erd:options"].execute
assert_equal %w[content timestamps], RailsERD.options.attributes
end
+
+ test "options task should set known integer command line options when value is only digits" do
+ ENV["only_recursion_depth"] = "2"
+ Rake::Task["erd:options"].execute
+ assert_equal 2, RailsERD.options.only_recursion_depth
+ end
+
+ test "options task sets known command line options as symbols when not boolean or numeric" do
+ ENV["only_recursion_depth"] = "test"
+ Rake::Task["erd:options"].execute
+ assert_equal :test, RailsERD.options.only_recursion_depth
+ end
+
+ test "options task should set single parameter to only as array xxx" do
+ ENV["only"] = "model"
+ Rake::Task["erd:options"].execute
+ assert_equal ["model"], RailsERD.options.only
+ end
end