Class: Spec::FactoryGirl::Matchers::BeBuiltByFactory
- Inherits:
-
Base
- Object
- Base
- Spec::FactoryGirl::Matchers::BeBuiltByFactory
show all
- Defined in:
- lib/spec/factory_girl/matchers/be_built_by_factory.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#description ⇒ Object
5
6
7
|
# File 'lib/spec/factory_girl/matchers/be_built_by_factory.rb', line 5
def description
"build instance of '#{@target}' by factory '#{@factory}'"
end
|
#failure_message_for_should ⇒ Object
17
18
19
|
# File 'lib/spec/factory_girl/matchers/be_built_by_factory.rb', line 17
def failure_message_for_should
"expected #{@target.inspect} to be build by factory '#{@factory}'\n" + @errors.join("\n")
end
|
#failure_message_for_should_not ⇒ Object
21
22
23
|
# File 'lib/spec/factory_girl/matchers/be_built_by_factory.rb', line 21
def failure_message_for_should_not
"expected #{@target.inspect} not to be build by factory '#{@factory}'"
end
|
#matches?(target) ⇒ Boolean
9
10
11
12
13
14
15
|
# File 'lib/spec/factory_girl/matchers/be_built_by_factory.rb', line 9
def matches?(target)
prepare_matches(target)
@result = Factory.build(@factory)
super
end
|