Commit Graph

13 Commits

Author SHA1 Message Date
Peter Goldstein 3e57eb531f
Add Ruby 3.1 to CI (#558)
* Add Ruby 3.1 to CI

Update Rubocop for recent Rubies
Disable Rubocop run for Rubies before Ruby 2.4
Quote '3.0' in the CI configuration to ensure it loads a 3.0.x Ruby
Set RUBYOPT="--disable_error_highlight" so Ruby 3.1 error matchers pass

* Add CHANGELOG.md entry

* Re-add deleted line from CHANGELOG.md

* Set minimum supported Ruby version to 2.4.

Remove a number of code bits designed to support Rubies below version 2.4

* Bump version.  Remove unneeded require from Gemfile.  Add require to spec/support file
2022-01-27 18:59:24 -08:00
Michael Herold f152e25912
Fix inconsistencies with Dash defaults
The normal behavior of Dash with respect to property defaults differed
from the behavior of a Dash/Trash with IgnoreUndeclared mixed in. This
is because some situations called the defaults and some did not.

This change normalizes the behavior so that all situations where the
defaults should be used to override unset values behave consistently,
as well as all situations where the default should not override a `nil`
value.
2020-10-23 21:57:10 -05:00
Michael Herold eb69c58b62
Don't warn when setting most affixed keys (#500)
Due to how we have implemented the bang/underbang/query behavior within
Mash, setting keys that have those affixes in them actually allow
overwriting the behavior of those affixes. As such, we shouldn't warn
when setting a key that matches those patterns.

When it comes to setter-like keys, I believe we still _do_ want to warn
for two reasons:

1. Trying to access the key via method access is a syntax error. Ruby
   expects any method ending in `=` to be a 2+-arity method due to the
   infix notation of setter methods. This is unexpected behavior unless
   you're very familiar with Ruby parsing.
2. You can still retrieve the key via the normal `Hash#[]` reader, but
   it prevents setting a similar key without the equal sign. You can see
   this in the test about setters. I'd say that is unexpected and
   surprising behavior.

Because of these two gotchas, I think we should still warn in cases
where you try to set a key that looks like a setter.
2020-01-15 13:17:27 -06:00
Daniel Doubrovkine (dB.) @dblockdotorg 839f874cf9 Merge pull request #397 from michaelherold/improve-integration-tests
Bring integration tests into main test harness
2017-02-04 20:22:01 -05:00
Michael Herold f50cf8e6bb Bring integration tests into main test harness
We have a nice integration spec harness, so let's make sure we use it
when we're working on the gem. I'm making the following changes:

* Make `bundle exec rake` run integration specs, except on Travis.
* Silence a warning in the OmniAuth integration spec that has nothing to
  do with Hashie.
* Make Guard run integration specs when appropriate. Now, when you run
  all tasks you will run integration specs. Also, if you modify an
  integration spec, it will run. Lastly, if you modify anything in `lib`
  the integration specs will run.
* Keeps the extra Travis build that only runs integration specs. Travis
  didn't like the Rake task that included it and there's extra signal by
  doing it this way anyway.
2017-02-03 15:20:21 -06:00
Bill Ruddock 330cfa1c2a Fix specs using shared context 'with a logger'
Correct usage of a shared_context is to use include_context
2017-02-03 00:58:01 +00:00
Michael Herold e35e628ddd Add a logging layer to address common issues (#381) 2016-11-02 06:47:33 -04:00
sazor c1c9dcc80b Check ruby version without rubygems 2016-10-18 09:47:28 +03:00
jonathan schatz fa524096f3 Fix support for Array#dig 2016-06-01 14:53:29 -07:00
Peter Boling 43d86f1c52 @dblock
- a one liner with no complexity for pending specs by Ruby Engine / Version
- removes all complexity from Hashie
2015-10-22 02:07:21 -07:00
Peter Boling a44dd9a268 - Restrict pending the spec to only Ruby versions 2.2.0, 2.2.1, 2.2.2
- Better paradigm for pending specs due to bugs in interpreter
2015-10-18 22:16:47 -07:00
Michael Herold 35756e1641 Add a conditional check for 2.2.x specs
This adds a way to handle the broken spec in MRI 2.2.x that was
introduced by a regression in the language. It is slated to be in 2.3.0
and seems partially fixed in 2.2.2.

In order to have the full spec suite run on every version of Ruby but
keep the brevity of the Mash specs, we needed a way to check for the
Ruby version and selectively disable the two errant specs.

We need to be testing on the latest Ruby, so this seems to be the best
compromise.

For more information on the breakage in Ruby, see [issue 285][rubybug].

For more information on this decision, see [issue 294][workaround].

Fixes #294
/cc #285

[rubybug]: https://github.com/intridea/hashie/pull/285
[workaround]: https://github.com/intridea/hashie/pull/294
2015-04-18 19:31:06 -05:00
Bartosz Kopiński ea2076ba6c Update key conversion extensions
Fixing collision with ActiveSupport

ActiveSupport implementation is not recursive
2014-12-08 17:54:49 -05:00