[rspec-users] Augmenting a previous 'let' value

2012-12-21 Thread Arne Brasseur
I find myself wanting to do something like this, and I'm curious to hear what others think of this pattern. describe "a hash with two values" do let(:hsh) {{ xxx: 1, yyy: 2 }} context "with a third value added" do alias _hsh hsh let(:hsh) { _hsh.merge(zzz: 3) } it "should contain

Re: [rspec-users] Rspec matchers confused by hashes?

2013-05-02 Thread Arne Brasseur
This syntax should work @test_hash["foobar"].size.should eq(1) But @test_hash["foobar"] evaluates to ["a","b","c"], so its size is actually 3. On May 3, 2013 12:12 AM, "Kwasi Mensah" wrote: > sorry if this gets posted twice. I accidentally sent this before I was > confirmed for the mailing lis