Exception: MissingFixtureError

Inherits:
JoinFixError show all
Defined in:
lib/joinfix/error.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from JoinFixError

#entry_name, #fixtures, #msg

Instance Method Summary collapse

Methods inherited from JoinFixError

new

Constructor Details

#initialize(table_name) ⇒ MissingFixtureError

Returns a new instance of MissingFixtureError.



25
26
27
28
# File 'lib/joinfix/error.rb', line 25

def initialize(table_name)
   @fixtures = table_name
	@table_name = table_name
end

Instance Attribute Details

#table_nameObject (readonly)

Returns the value of attribute table_name.



24
25
26
# File 'lib/joinfix/error.rb', line 24

def table_name
  @table_name
end

Instance Method Details

#adviceObject



35
36
37
38
39
40
41
42
# File 'lib/joinfix/error.rb', line 35

def advice
	%Q{
Be sure you've specified all the tables for which your fixtures create entries.
---
class UserTest < Test::Unit::TestCase
 fixtures :users, :groups, :user_groups  # => got to name them all!!!
end}
end

#messageObject



30
31
32
33
# File 'lib/joinfix/error.rb', line 30

def message
	"No fixture loaded for <#{table_name}>\n" +
	(advice.nil? ? '' : "#{advice}\n")
end