tomykaira / rspec-parameterized

RSpec::Parameterized supports simple parameterized test syntax in rspec.
MIT License
417 stars 28 forks source link

Changes to apply method calls recursively when parameter is Array or Hash. #75

Closed yiyenene closed 2 years ago

yiyenene commented 2 years ago

what

Implements recursive_apply method that is calls apply method of Arg class to children of Array or Hash parameters.

why

When I want to use array or hash parameters with ref or lazy, it didn't applies properly.

let(:foo) { 1 }

where(:values, :answer) do
  [
    [[ref(:foo), 2], 2],
  ]
end

with_them do
  it { expect(values.sum).to eq(answer) } # values => [:foo, 2] 
end
sue445 commented 2 years ago

I think this is LGTM.

@joker1007 How do you think?

sue445 commented 2 years ago

@yiyenene I released v0.5.1 💎 https://github.com/tomykaira/rspec-parameterized/blob/master/CHANGELOG.md#v051-2022-01-04