File: commands_on_lists_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 (20 lines) | stat: -rw-r--r-- 478 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
# encoding: UTF-8

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/lists"

class TestCommandsOnLists < Test::Unit::TestCase

  include Helper::Client
  include Lint::Lists

  def test_rpoplpush
    r.rpush "foo", "s1"
    r.rpush "foo", "s2"

    assert_equal "s2", r.rpoplpush("foo", "bar")
    assert_equal ["s2"], r.lrange("bar", 0, -1)
    assert_equal "s1", r.rpoplpush("foo", "bar")
    assert_equal ["s1", "s2"], r.lrange("bar", 0, -1)
  end
end