File: persistence_control_commands_test.rb

package info (click to toggle)
ruby-redis 3.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 736 kB
  • ctags: 1,128
  • sloc: ruby: 8,149; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 571 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# encoding: UTF-8

require File.expand_path("helper", File.dirname(__FILE__))

class TestPersistenceControlCommands < Test::Unit::TestCase

  include Helper::Client

  def test_save
    redis_mock(:save => lambda { "+SAVE" }) do |redis|
      assert_equal "SAVE", redis.save
    end
  end

  def test_bgsave
    redis_mock(:bgsave => lambda { "+BGSAVE" }) do |redis|
      assert_equal "BGSAVE", redis.bgsave
    end
  end

  def test_lastsave
    redis_mock(:lastsave => lambda { "+LASTSAVE" }) do |redis|
      assert_equal "LASTSAVE", redis.lastsave
    end
  end
end