diff options
Diffstat (limited to 'spec/integration/rails/integration_spec.rb')
-rw-r--r-- | spec/integration/rails/integration_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/integration/rails/integration_spec.rb b/spec/integration/rails/integration_spec.rb index 9b150a2..dc1d670 100644 --- a/spec/integration/rails/integration_spec.rb +++ b/spec/integration/rails/integration_spec.rb @@ -19,6 +19,24 @@ RSpec.describe 'rails', type: :request do expect(Hashie.logger).to eq(Rails.logger) end + context '#except' do + subject { Hashie::Mash.new(x: 1, y: 2) } + + it 'returns an instance of the class it was called on' do + class HashieKlass < Hashie::Mash; end + hashie_klass = HashieKlass.new(subject) + expect(hashie_klass.except('x')).to be_a HashieKlass + end + + it 'works with string keys' do + expect(subject.except('x')).to eq Hashie::Mash.new(y: 2) + end + + it 'works with symbol keys' do + expect(subject.except(:x)).to eq Hashie::Mash.new(y: 2) + end + end + it 'works' do get '/' assert_select 'h1', 'Hello, world!' |