Module: FilePattern::Assertions::ClassMethods

Includes:
Test::Unit::Assertions
Included in:
FilePattern
Defined in:
app/models/file_pattern.rb

Instance Method Summary collapse

Instance Method Details

#assert_invariantObject

conditions that are always true (at least atomically)


142
143
144
# File 'app/models/file_pattern.rb', line 142

def assert_invariant
#	fail "end of assert_invariant "
end

#assert_pattern_array(array, array_message = '') ⇒ Object

class_assert_post_conditions


160
161
162
163
164
165
166
# File 'app/models/file_pattern.rb', line 160

def assert_pattern_array(array, array_message='')
	assert_not_empty(array, array_message)
	array.each_with_index do |n, i| 
		message=array_message+" \n n=#{n.inspect}"
		n.assert_pre_conditions(message)
	end #map
end

#assert_post_conditionsObject

assertions true after class (and nested module Examples) is defined


151
152
153
154
155
156
157
158
159
# File 'app/models/file_pattern.rb', line 151

def assert_post_conditions
	path=File.expand_path($0)
	assert_not_nil(path)
	assert_not_empty(path)
	assert(File.exists?(path))
#	assert_not_empty(FilePattern.class_variables)
#	assert_include(FilePattern.class_variables, :@@project_root_dir)
#	assert_pathname_exists(FilePattern.class_variable_get(:@@project_root_dir))
end

#assert_pre_conditionsObject

conditions true while class is being defined


146
147
148
149
# File 'app/models/file_pattern.rb', line 146

def assert_pre_conditions
	assert_respond_to(FilePattern, :project_root_dir?)
	assert_module_included(self, FilePattern::Assertions)
end