git ssb

0+

dangerousbeans / %aPBe2k3ugtjBr4rrsU1…



Commit 8b90c357e99debc6e49cef5bf027c1034d12a097

Added another spec for generating salts.

Reduced the cost of spec'd passwords to 4, to speed up spec execution.


git-svn-id: http://bcrypt-ruby.rubyforge.org/svn/trunk@13 b1e0f299-433e-4bb3-9895-84128a6cfb6a
codahale committed on 2/28/2007, 6:36:55 AM
Parent: 024b702838a0d932e17d91cbd0a1c939c9c3a296

Files changed

spec/bcrypt/engine_spec.rbchanged
spec/bcrypt/password_spec.rbchanged
spec/bcrypt/engine_spec.rbView
@@ -20,14 +20,18 @@
2020
2121 specify "should raise a InvalidCostError if the cost parameter isn't numeric" do
2222 lambda { BCrypt::Engine.generate_salt('woo') }.should raise_error(BCrypt::Errors::InvalidCost)
2323 end
24 +
25 + specify "should raise a InvalidCostError if the cost parameter isn't greater than 0" do
26 + lambda { BCrypt::Engine.generate_salt(-1) }.should raise_error(BCrypt::Errors::InvalidCost)
27 + end
2428 end
2529
2630 context "Generating BCrypt hashes" do
2731
2832 setup do
29- @salt = BCrypt::Engine.generate_salt(5)
33 + @salt = BCrypt::Engine.generate_salt(4)
3034 @password = "woo"
3135 end
3236
3337 specify "should produce a string" do
spec/bcrypt/password_spec.rbView
@@ -3,9 +3,9 @@
33 context "Creating a hashed password" do
44
55 setup do
66 @secret = "wheedle"
7- @password = BCrypt::Password.create(@secret)
7 + @password = BCrypt::Password.create(@secret, :cost => 4)
88 end
99
1010 specify "should return a BCrypt::Password" do
1111 @password.should be_an_instance_of(BCrypt::Password)

Built with git-ssb-web