title: Can you simultaneously test a state change and a return value in RSpec?
body: <p>Say I have a method <code>MyKlass#do_thing</code> that I want to call exactly once in a test (because it might change a state), and that should return <code>true</code> on successful state change and <code>false</code> otherwise. I want to write a spec that looks something like this:</p>
  
  <pre><code>it "Updates myvalue if condition is met" do
    wojit = MyKlass.new
  
    # ... assuming condition is met
    expect { wojit.do_thing }.to change { wojit.value }.and.be true
  end
  </code></pre>
  
  <p>But this particular approach gets an ArgumentError, because <code>#and</code> expects 1 argument. </p>
  
  <p>I can make it work with the following abomination:</p>
  
  <pre><code>expect { expect(wojit.do_thing).to be true }.to change { wojit.value }
  </code></pre>
  
  <p>But that is hiiiiideous. Am I missing something more idiomatic?</p>