summaryrefslogtreecommitdiff
path: root/spec/trocla/util_spec.rb
blob: 4e02d9700a4c1b9648cafb64e7200c0bf9bafb2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Trocla::Util" do
  describe "random_str" do
    it "should be random" do
      Trocla::Util.random_str.should_not eql(Trocla::Util.random_str)
    end
    
    it "should default to length 12" do
      Trocla::Util.random_str.length.should == 12
    end
    
    it "should be possible to change length" do
      Trocla::Util.random_str(8).length.should == 8
      Trocla::Util.random_str(32).length.should == 32
      Trocla::Util.random_str(1).length.should == 1
    end
  end
end