Skip to content

Unexpected implementation of == method in Password class #266

Closed

Description

@MatzFan
require 'bcrypt'

my_password = BCrypt::Password.create('my password')
my_password == 'my password'   #=> true
'my password' == my_password   #=> false!!!

This is an unexpected result for a class that sub-classes String. Maybe better to implement to_str instead?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions