Kouhei Sutou
null+****@clear*****
Wed Apr 26 15:19:43 JST 2017
Kouhei Sutou 2017-04-26 15:19:43 +0900 (Wed, 26 Apr 2017) New Revision: ab55abb6aae57a36b1194e1d9786611366f85f65 https://github.com/ranguba/groonga-client/commit/ab55abb6aae57a36b1194e1d9786611366f85f65 Message: test: remove needless tests For example, the following case focuses Ruby's basic feature (argument check feature). It's not a test area of us. test("no values") do assert_raise(ArgumentError){ between("tags") } end For example, the following case doesn't show expected behavior. We expect String or Symbol as the first argument. We don't expect number as the first argument. It's unexpected behavior (we can validate the first argument or we just use the argument value because it's responsive of user). We shouldn't add a test for the unexpected behavior. If we validate the first argument then it's reasonable that we add a test that the method raises for wrong value. test("number_include") do assert_equal({ :table => "posts", :filter => "between(10, 2, \"include\", 29, \"include\")", }, between(10, 2, "include", 29, "include")) end Modified files: test/request/test-select.rb Modified: test/request/test-select.rb (+3 -35) =================================================================== --- test/request/test-select.rb 2017-04-26 15:17:51 +0900 (aae9c8e) +++ test/request/test-select.rb 2017-04-26 15:19:43 +0900 (c6b9f40) @@ -101,44 +101,12 @@ class TestRequestSelect < Test::Unit::TestCase max, max_border).to_parameters end - test("column_name_include") do + test("border") do assert_equal({ :table => "posts", - :filter => "between(ages, 2, \"include\", 29, \"include\")", + :filter => "between(ages, 2, \"include\", 29, \"exclude\")", }, - between("ages", 2, "include", 29, "include")) - end - - test("column_name_exclude") do - assert_equal({ - :table => "posts", - :filter => "between(ages, 2, \"exclude\", 29, \"exclude\")", - }, - between("ages", 2, "exclude", 29, "exclude")) - end - - test("number_include") do - assert_equal({ - :table => "posts", - :filter => "between(10, 2, \"include\", 29, \"include\")", - }, - between(10, 2, "include", 29, "include")) - end - - test("number_exclude") do - assert_equal({ - :table => "posts", - :filter => "between(10, 2, \"exclude\", 29, \"exclude\")", - }, - between(10, 2, "exclude", 29, "exclude")) - end - - test("no values") do - assert_raise(ArgumentError){ between("tags") } - end - - test("too much values") do - assert_raise(ArgumentError){ between("ages", 2, "include", 29, "include", 3) } + between("ages", 2, "include", 29, "exclude")) end end -------------- next part -------------- HTML����������������������������... Descargar