diff options
author | mh <mh@immerda.ch> | 2011-07-27 18:43:55 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2011-07-27 18:43:55 +0200 |
commit | 9146a541ff96b92f4f14c6292307b68dc4673097 (patch) | |
tree | 3637ab49056565fad3566d78698634c2a6ab7265 /spec/trocla |
initial release of trocla
Diffstat (limited to 'spec/trocla')
-rw-r--r-- | spec/trocla/util_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/trocla/util_spec.rb b/spec/trocla/util_spec.rb new file mode 100644 index 0000000..4e02d97 --- /dev/null +++ b/spec/trocla/util_spec.rb @@ -0,0 +1,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
\ No newline at end of file |