File: let_mock_helper.rb

package info (click to toggle)
ruby-morpher 0.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 520 kB
  • sloc: ruby: 2,366; makefile: 4
file content (8 lines) | stat: -rw-r--r-- 184 bytes parent folder | download
1
2
3
4
5
6
7
8
module LetMockHelper
  def let_mock(name, &block)
    let(name) do
      stubs = block ? instance_exec(double, &block) : {}
      double(name.to_s.capitalize, stubs)
    end
  end
end