File: null_factory_spec.rb

package info (click to toggle)
ruby-factory-bot 6.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,372 kB
  • sloc: ruby: 7,827; makefile: 6
file content (49 lines) | stat: -rw-r--r-- 1,439 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
40
41
42
43
44
45
46
47
48
49
describe FactoryBot::NullFactory do
  it "delegates defined traits to its definition" do
    null_factory = FactoryBot::NullFactory.new

    expect(null_factory).to delegate(:defined_traits).to(:definition)
  end

  it "delegates callbacks to its definition" do
    null_factory = FactoryBot::NullFactory.new

    expect(null_factory).to delegate(:callbacks).to(:definition)
  end

  it "delegates attributes to its definition" do
    null_factory = FactoryBot::NullFactory.new

    expect(null_factory).to delegate(:attributes).to(:definition)
  end

  it "delegates constructor to its definition" do
    null_factory = FactoryBot::NullFactory.new

    expect(null_factory).to delegate(:constructor).to(:definition)
  end

  it "has a nil value for its compile attribute" do
    null_factory = FactoryBot::NullFactory.new

    expect(null_factory.compile).to be_nil
  end

  it "has a nil value for its class_name attribute" do
    null_factory = FactoryBot::NullFactory.new

    expect(null_factory.class_name).to be_nil
  end

  it "has an instance of FactoryBot::AttributeList for its attributes attribute" do
    null_factory = FactoryBot::NullFactory.new

    expect(null_factory.attributes).to be_an_instance_of(FactoryBot::AttributeList)
  end

  it "has FactoryBot::Evaluator as its evaluator class" do
    null_factory = FactoryBot::NullFactory.new

    expect(null_factory.evaluator_class).to eq FactoryBot::Evaluator
  end
end