diff --git a/test/sqlite_test.rb b/test/sqlite_test.rb index edcb020..c4b83fc 100644 --- a/test/sqlite_test.rb +++ b/test/sqlite_test.rb @@ -12,4 +12,18 @@ class TestSqlite < Minitest::Test true end end + + def test_where_after + skip + end + + def call_method(method, field, options) + if method == :quarter || options[:time_zone] || options[:day_start] || options[:week_start] || Groupdate.week_start != :sun || (Time.zone && options[:time_zone] != false) + error = assert_raises(Groupdate::Error) { super } + assert_includes error.message, "not supported for SQLite" + skip # after assertions + else + super + end + end end diff --git a/test/test_helper.rb b/test/test_helper.rb index bb3f57b..614aca9 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -235,7 +235,7 @@ module TestDatabase last_month.to_date => 0, this_month.to_date => 1 } - assert_equal expected, User.group_by_month(:created_on, last: 2).count + assert_equal expected, call_method(:month, :created_on, last: 2) ensure Time.zone = nil end @@ -264,7 +264,7 @@ module TestDatabase last_quarter.to_date => 0, this_quarter.to_date => 1 } - assert_equal expected, User.group_by_quarter(:created_at, last: 2).count + assert_equal expected, call_method(:quarter, :created_at, last: 2) end def test_format_locale @@ -369,7 +369,7 @@ module TestDatabase Date.parse("2014-10-19") => 1, Date.parse("2014-10-20") => 1 } - assert_equal expected, User.group_by_day(:created_at, time_zone: "Brasilia").count + assert_equal expected, call_method(:day, :created_at, time_zone: "Brasilia") end # carry_forward option -- libgit2 0.21.0