Module: OpenTableExplorer::Finance::TaxForm::Assertions

Includes:
Test::Unit::Assertions
Included in:
OpenTableExplorer::Finance::TaxForm
Defined in:
app/models/tax_form.rb

Overview

run_pdf_to_jpeg

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#assert_buildObject

assert_json_to_fdf


161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'app/models/tax_form.rb', line 161

def assert_build
#	@open_tax_solver_run.assert_open_tax_solver
#	@ots_to_json_run.assert_ots_to_json
#	@json_to_fdf_run.assert_json_to_fdf
#	@fdf_to_pdf_run.assert_fdf_to_pdf
#	@pdf_to_jpeg_run.assert_pdf_to_jpeg
	if !@open_tax_solver_run.success? then
		assert_open_tax_solver
	elsif !@ots_to_json_run.success? then
		@json_to_fdf_run.assert_post_conditions
	elsif !@json_to_fdf_run.success? then
		assert_json_to_fdf
	elsif !@fdf_to_pdf_run.success? then
				@fdf_to_pdf_run.puts
	else
		assert_pdf_to_jpeg
	end #if
	self
end

#assert_fdf_to_pdfObject

assert_json_to_fdf


155
156
157
# File 'app/models/tax_form.rb', line 155

def assert_fdf_to_pdf
	@fdf_to_pdf_run.assert_post_conditions
end

#assert_json_to_fdfObject

assert_open_tax_solver


152
153
154
# File 'app/models/tax_form.rb', line 152

def assert_json_to_fdf
	@json_to_fdf_run.assert_post_conditions
end

#assert_open_tax_solverObject

ClassMethods


131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'app/models/tax_form.rb', line 131

def assert_open_tax_solver
#	@open_tax_solver_run.assert_post_conditions
	peculiar_status=@open_tax_solver_run.process_status.exitstatus==1
	if File.exists?(@open_tax_solver_sysout) then
		message=IO.binread(@open_tax_solver_sysout)
	else
		message="file=#{@open_tax_solver_sysout} does not exist"
	end #if
	message+=@open_tax_solver_run.errors
	@open_tax_solver_run.puts
	puts "peculiar_status=#{peculiar_status}"
	puts "message='#{message}'"
	if peculiar_status then
		warn(message)
		warn('[email protected]_tax_solver_run.success?='+(!@open_tax_solver_run.success?).to_s)
	else
		@open_tax_solver_run.assert_post_conditions('else peculiar_status')
	end #if
	assert_pathname_exists(@open_tax_solver_output)
	assert_pathname_exists(@open_tax_solver_sysout)
end

#assert_pdf_to_jpegObject

assert_json_to_fdf


158
159
160
# File 'app/models/tax_form.rb', line 158

def assert_pdf_to_jpeg
	@pdf_to_jpeg_run.assert_post_conditions
end

#assert_post_conditions(message = '') ⇒ Object

assert_pre_conditions


184
185
186
187
188
# File 'app/models/tax_form.rb', line 184

def assert_post_conditions(message='')
	assert_pathname_exists(@open_tax_solver_directory, message+caller_lines)
	assert_pathname_exists(@open_tax_solver_data_directory, message+caller_lines)
	assert_pathname_exists(@open_tax_solver_output, message+caller_lines)
end

#assert_pre_conditions(message = '') ⇒ Object

build


180
181
182
183
# File 'app/models/tax_form.rb', line 180

def assert_pre_conditions(message='')
	assert_pathname_exists(@open_tax_solver_input, message)
	assert_pathname_exists(@open_tax_solver_data_directory, message)
end