Module: StreamMethodArgument::Assertions

Includes:
DefaultAssertions
Included in:
StreamMethodArgument
Defined in:
app/models/stream_method_argument.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#assert_invariantObject

true at all times


59
60
61
62
63
64
65
66
67
68
# File 'app/models/stream_method_argument.rb', line 59

def assert_invariant
	assert_instance_of(StreamMethodArgument, self)
	assert(!self.class.sequential_id?, "self.class=#{self.class}, should not be a sequential_id.")
	assert_not_empty(name, inspect)
	assert_not_empty(self[:name], inspect)
	assert_not_empty(self['name'], inspect)
	assert_not_empty(direction, inspect)
	assert_empty(self[:catfish], inspect)
	assert_include(['Input', 'Output'], direction)
end

#assert_post_conditionsObject

conditions after all ActiveRecord reading and initialization


74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'app/models/stream_method_argument.rb', line 74

def assert_post_conditions
	assert_not_nil(stream_method, inspect)
	assert_constant_path_respond_to(:Generic_Table, :stream_method)
	assert_constant_instance_respond_to(:Generic_Table, :association_state)

	assert_constant_path_respond_to(:StreamMethodArgument, :stream_method)
	assert_constant_path_respond_to(:StreamMethodArgument, :association_state)
	assert_constant_path_respond_to(:GenericTableAssociation, :association_state)
	assert_constant_path_respond_to(:GenericTableAssociation, :ClassMethods, :association_state)
	assert_constant_instance_respond_to(:StreamMethodArgument, :First_stream_argument, :association_state)
	assert_instance_of(StreamMethodArgument, StreamMethodArgument::First_stream_argument)
	assert_include(StreamMethodArgument::First_stream_argument.public_methods, :association_state, StreamMethodArgument::First_stream_argument.public_methods)
	assert_respond_to(StreamMethodArgument::First_stream_argument, :association_state, StreamMethodArgument::First_stream_argument.methods)
	assert_equal('', StreamMethodArgument::First_stream_argument.association_state(:stream_method))
end

#assert_pre_conditionsObject

true after creating an object from scratch


70
71
72
# File 'app/models/stream_method_argument.rb', line 70

def assert_pre_conditions
#	fail "end of instance assert_pre_conditions"
end