File: rspec_ext.rb

package info (click to toggle)
ruby-rspec-retry 0.6.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 220 kB
  • sloc: ruby: 574; makefile: 6
file content (39 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module RSpec
  module Core
    class Example
      attr_accessor :attempts

      def clear_exception
        @exception = nil
      end

      class Procsy
        def run_with_retry(opts = {})
          RSpec::Retry.new(self, opts).run
        end

        def attempts
          @example.attempts
        end
      end
    end
  end
end

module RSpec
  module Core
    class ExampleGroup
      def clear_memoized
        if respond_to? :__init_memoized, true
          __init_memoized
        else
          @__memoized = nil
        end
      end

      def clear_lets
        clear_memoized
      end
    end
  end
end