File: build.rb

package info (click to toggle)
ruby-factory-bot 6.5.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,492 kB
  • sloc: ruby: 9,242; makefile: 6; sh: 4
file content (21 lines) | stat: -rw-r--r-- 367 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module FactoryBot
  module Strategy
    class Build
      def association(runner)
        runner.run
      end

      def result(evaluation)
        evaluation.notify(:before_build, nil)

        evaluation.object.tap do |instance|
          evaluation.notify(:after_build, instance)
        end
      end

      def to_sym
        :build
      end
    end
  end
end