Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: 8.2.1 regression tests #1265

Merged
merged 16 commits into from
Nov 14, 2024
Merged

feature: 8.2.1 regression tests #1265

merged 16 commits into from
Nov 14, 2024

Conversation

askonev
Copy link
Member

@askonev askonev commented Nov 12, 2024

No description provided.

@askonev askonev changed the title feature: 8.2.1 fixes & features feature: 8.2.1 regression tests Nov 13, 2024
@askonev
Copy link
Member Author

askonev commented Nov 14, 2024

hash with a type other than string will return

describe 'Custom Matchers' do
  let(:example_hash) do
    {
      string: 'Hello World', # String
      integer: 42, # Integer
      float: 3.14, # Float
      boolean: true, # Boolean (true)
      boolean_false: false, # Boolean (false)
      symbol: :ruby, # Symbol
      array: [1, 2, 3], # Array
      nested_hash: { a: 1, b: 2 }, # Hash
      date: Date.new(2024, 1, 1), # Date object
      time: Time.now, # Time object
      regexp: /\d+/, # Regular Expression
      range: (1..5), # Range
      proc: -> { puts 'Hello' }, # Proc/Lambda
      set: Set.new([1, 2, 3]), # Set
      class_name: String, # Class
      multiline_string: <<~HEREDOC # Heredoc (multiline string)
        This is a
        multiline string
      HEREDOC
    }
  end

  it 'hash_have_no_empty_string_values' do
    expect(example_hash).to hash_have_no_empty_string_values
  end
end
expected hash to have only non-empty string values, but ["found non-string values: integer: Integer, float: Float, boolean: TrueClass, boolean_false: FalseClass, symbol: Symbol, array: Array, nested_hash: Hash, date: Date, time: Time, regexp: Regexp, range: Range, proc: Proc, set: Set, class_name: Class"]

  0) Custom Matchers hash_have_no_empty_string_values
     Failure/Error: expect(example_hash).to hash_have_no_empty_string_values
       expected hash to have only non-empty string values, but ["found non-string values: integer: Integer, float: Float, boolean: TrueClass, boolean_false: FalseClass, symbol: Symbol, array: Array, nested_hash: Hash, date: Date, time: Time, regexp: Regexp, range: Range, proc: Proc, set: Set, class_name: Class"]
     # ./project_spec/unit/custom_matchers_spec.rb:31:in `block (2 levels) in <top (required)>'

@askonev askonev requested review from lemonowl and removed request for lemonowl November 14, 2024 12:48
@askonev askonev merged commit 6cca9b2 into master Nov 14, 2024
9 checks passed
@askonev askonev deleted the feature/8.2.1 branch November 14, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants