Skip to content

Unexpected implementation of == method in Password class #266

@MatzFan

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?

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