test/embulk/input/test_mixpanel.rb in embulk-input-mixpanel-0.3.0 vs test/embulk/input/test_mixpanel.rb in embulk-input-mixpanel-0.3.1
- old
+ new
@@ -191,12 +191,26 @@
mock(Mixpanel).resume(task.merge(dates: target_dates), columns, 1, &control)
Mixpanel.transaction(transaction_config, &control)
end
+ def test_info
+ stub(Mixpanel).resume(task.merge(dates: target_dates), columns, 1, &control)
+
+ info_message_regexp = /#{Regexp.escape(target_dates.first)}.+#{Regexp.escape(target_dates.last)}/
+ mock(Embulk.logger).info(info_message_regexp)
+ stub(Embulk.logger).warn
+
+ Mixpanel.transaction(transaction_config, &control)
+ end
+
def test_warn
stub(Mixpanel).resume(task.merge(dates: target_dates), columns, 1, &control)
- mock(Embulk.logger).warn(anything)
+ stub(Embulk.logger).info
+
+ ignore_dates = dates.map{|date| date.to_s}.to_a - target_dates
+ warn_message_regexp = /#{Regexp.escape(ignore_dates.first)}.+#{Regexp.escape(ignore_dates.last)}/
+ mock(Embulk.logger).warn(warn_message_regexp)
Mixpanel.transaction(transaction_config, &control)
end
private