diff options
author | mh <mh@immerda.ch> | 2011-08-05 14:12:09 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2011-08-05 14:12:09 +0200 |
commit | 1d5f20953d6a4bf6de8dab1d915b4d252eb4a790 (patch) | |
tree | 9bd9af33ff661d7c4bff1647998dc956af55a06d /spec | |
parent | 3565f7550a1d604ed248ad0174af6cccd59f8131 (diff) |
cleanup code and improve test naming
Diffstat (limited to 'spec')
-rw-r--r-- | spec/trocla_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/trocla_spec.rb b/spec/trocla_spec.rb index c6cb94c..fe95520 100644 --- a/spec/trocla_spec.rb +++ b/spec/trocla_spec.rb @@ -44,23 +44,23 @@ describe "Trocla" do describe "set_password" do it "should reset hashed passwords on a new plain password" do - @trocla.password('reset_test','mysql').should_not be_empty - @trocla.get_password('reset_test','mysql').should_not be_nil - (old_plain=@trocla.password('reset_test','mysql')).should_not be_empty + @trocla.password('set_test','mysql').should_not be_empty + @trocla.get_password('set_test','mysql').should_not be_nil + (old_plain=@trocla.password('set_test','mysql')).should_not be_empty - @trocla.set_password('reset_test','plain','foobar').should_not eql(old_plain) - @trocla.get_password('reset_test','mysql').should be_nil + @trocla.set_password('set_test','plain','foobar').should_not eql(old_plain) + @trocla.get_password('set_test','mysql').should be_nil end it "should otherwise only update the hash" do - (mysql = @trocla.password('reset_test2','mysql')).should_not be_empty - (md5crypt = @trocla.password('reset_test2','md5crypt')).should_not be_empty - (plain = @trocla.get_password('reset_test2','plain')).should_not be_empty + (mysql = @trocla.password('set_test2','mysql')).should_not be_empty + (md5crypt = @trocla.password('set_test2','md5crypt')).should_not be_empty + (plain = @trocla.get_password('set_test2','plain')).should_not be_empty - (new_mysql = @trocla.set_password('reset_test2','mysql','foo')).should_not eql(mysql) - @trocla.get_password('reset_test2','mysql').should eql(new_mysql) - @trocla.get_password('reset_test2','md5crypt').should eql(md5crypt) - @trocla.get_password('reset_test2','plain').should eql(plain) + (new_mysql = @trocla.set_password('set_test2','mysql','foo')).should_not eql(mysql) + @trocla.get_password('set_test2','mysql').should eql(new_mysql) + @trocla.get_password('set_test2','md5crypt').should eql(md5crypt) + @trocla.get_password('set_test2','plain').should eql(plain) end end |