File: stub_instance_of_spec.rb

package info (click to toggle)
ruby-rr 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,424 kB
  • sloc: ruby: 11,405; makefile: 7
file content (15 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require File.expand_path('../../spec_helper', __FILE__)

permutations =
  %w(stub instance_of).permutation.map { |parts| parts.join('.') } +
  %w(instance_of)

permutations.each do |permutation|
  describe permutation, is_instance_of: true do
    include_context 'stub + instance_of'

    define_method(:double_definition_creator_for) do |object, &block|
      eval(permutation + '(object, &block)')
    end
  end
end