File: array_spec.rb

package info (click to toggle)
imagetooth 2.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 252 kB
  • sloc: ruby: 275; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 1,129 bytes parent folder | download | duplicates (4)
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
27
28
29
30
31
##########################################################################
#  Copyright (C) 2007 Ramos, Gastón - ramos.gaston@gmail.com
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU General Public License for more details.
#
#########################################################################

$LOAD_PATH << '../lib'

require 'array_adds'

describe "Array" do

  it "Should be generate color sequence" do
    char_colors = ['r', 'w']
    char_colors.permut(2).should == [["r", "r"], ["r", "w"], ["w", "r"], ["w", "w"]]
  end

   it "Should be generate color sequence" do
    char_colors = [['r', 'w'], ['r', 'w']]
    char_colors.sequence.should == [["r", "r"], ["r", "w"], ["w", "r"], ["w", "w"]]
  end
end