doc/files/test/testhelper_rb.src/M000003.html in ripxplore-0.5.2 vs doc/files/test/testhelper_rb.src/M000003.html in ripxplore-0.7.0

- old
+ new

@@ -3,61 +3,16 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> - <title>sniff_url (test/testhelper.rb)</title> + <title>file_cache (test/testhelper.rb)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> - <pre><span class="ruby-comment cmt"># File test/testhelper.rb, line 27</span> -<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sniff_url</span>(<span class="ruby-identifier">url</span>,<span class="ruby-identifier">expected_image_format</span>,<span class="ruby-identifier">expected_file_system</span>,<span class="ruby-identifier">expected_files</span>=<span class="ruby-keyword kw">nil</span>) - <span class="ruby-identifier">assert</span>(<span class="ruby-constant">FileSystemImage</span>.<span class="ruby-identifier">is_file_system_image_filename?</span>(<span class="ruby-identifier">url</span>),<span class="ruby-node">&quot;#{url} should have a known file system image extension&quot;</span>) - <span class="ruby-identifier">image</span>=<span class="ruby-ivar">@@filecache</span>.<span class="ruby-identifier">get_file_system_image</span>(<span class="ruby-identifier">url</span>) - <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">expected_file_system</span>,<span class="ruby-identifier">image</span>.<span class="ruby-identifier">file_system</span>,<span class="ruby-node">&quot;validation of file system for #{url}&quot;</span>) - <span class="ruby-identifier">assert_kind_of</span>(<span class="ruby-identifier">expected_image_format</span>,<span class="ruby-identifier">image</span>.<span class="ruby-identifier">image_format</span>,<span class="ruby-node">&quot;validation of image format for #{url}&quot;</span>) - <span class="ruby-identifier">assert_not_nil</span>(<span class="ruby-identifier">image</span>.<span class="ruby-identifier">image_format</span>.<span class="ruby-identifier">host_system</span>.<span class="ruby-identifier">full_name</span>,<span class="ruby-value str">&quot;all host systems should implement :full_name&quot;</span>) - <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">expected_files</span>.<span class="ruby-identifier">nil?</span> - <span class="ruby-identifier">expected_files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">expected_file</span><span class="ruby-operator">|</span> - <span class="ruby-identifier">expected_file_filename</span>=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:filename</span>] - <span class="ruby-constant">RipXploreLog</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;validating #{expected_file_filename}&quot;</span>) - <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;no native files identified in image&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">image</span>.<span class="ruby-identifier">files</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">image</span>.<span class="ruby-identifier">files</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">==</span><span class="ruby-value">0</span> - <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;image.files should of type FileContainer but was #{image.files.class} (file system=#{image.file_system})&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">image</span>.<span class="ruby-identifier">files</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">FileContainer</span>) - <span class="ruby-identifier">native_file</span>=<span class="ruby-identifier">image</span>.<span class="ruby-identifier">files</span>[<span class="ruby-identifier">expected_file_filename</span>] - <span class="ruby-identifier">assert_not_nil</span>(<span class="ruby-identifier">native_file</span>,<span class="ruby-node">&quot;#{expected_file_filename} should exist in #{url} - files found: #{image.catalog}&quot;</span>) - <span class="ruby-identifier">expected_native_file_type</span>=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:expected_native_file_type</span>] - <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_native_file_type</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span> - <span class="ruby-identifier">assert_kind_of</span>(<span class="ruby-identifier">expected_native_file_type</span>,<span class="ruby-identifier">native_file</span>,<span class="ruby-node">&quot;native file type of #{expected_file_filename} should be as specified&quot;</span>) - <span class="ruby-keyword kw">end</span> - <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:load_address</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span> - <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:load_address</span>]<span class="ruby-operator">==</span><span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">load_address</span>,<span class="ruby-node">&quot;load address of #{expected_file_filename} should be $#{&quot;%04x&quot; % expected_file[:load_address]} but was $#{&quot;%04X&quot; % native_file.load_address}&quot;</span>) - <span class="ruby-keyword kw">end</span> - - <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:can_execute</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span> - <span class="ruby-identifier">method_to_call</span>=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:can_execute</span>] - <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">method_to_call</span>),<span class="ruby-node">&quot;#{expected_file_filename} [#{native_file.class}] should respond to :#{method_to_call}&quot;</span>) - <span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">method_to_call</span>) - <span class="ruby-keyword kw">end</span> - - <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:save_output</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span> - (<span class="ruby-identifier">method_to_call</span>,<span class="ruby-identifier">extension</span>)=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:save_output</span>] - <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">method_to_call</span>),<span class="ruby-node">&quot;#{expected_file_filename} [#{native_file.class}] should respond to :#{method_to_call}&quot;</span>) - <span class="ruby-identifier">file_cache</span>.<span class="ruby-identifier">purge_native_file_from_cache</span>(<span class="ruby-identifier">native_file</span>) - <span class="ruby-identifier">file_cache</span>.<span class="ruby-identifier">force_native_file_to_cache</span>(<span class="ruby-identifier">native_file</span>,<span class="ruby-identifier">method_to_call</span>,<span class="ruby-identifier">extension</span>) - <span class="ruby-keyword kw">end</span> - <span class="ruby-identifier">expected_file_text_starts_with</span>=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:text_starts_with</span>] - <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_file_text_starts_with</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span> - <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_text</span>),<span class="ruby-node">&quot;#{expected_file_filename} should respond to :to_text&quot;</span>) - <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">expected_file_text_starts_with</span>,<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">to_text</span>[<span class="ruby-value">0</span>,<span class="ruby-identifier">expected_file_text_starts_with</span>.<span class="ruby-identifier">length</span>],<span class="ruby-node">&quot;start of #{expected_file_filename} should be as specified&quot;</span>) - <span class="ruby-keyword kw">end</span> - - <span class="ruby-identifier">expected_file_listing_starts_with</span>=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:listing_starts_with</span>] - <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_file_listing_starts_with</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span> - <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_listing</span>),<span class="ruby-node">&quot;#{expected_file_filename} should respond to :to_listing&quot;</span>) - <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">expected_file_listing_starts_with</span>,<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">to_listing</span>[<span class="ruby-value">0</span>,<span class="ruby-identifier">expected_file_listing_starts_with</span>.<span class="ruby-identifier">length</span>],<span class="ruby-node">&quot;start of #{expected_file_filename} should be as specified&quot;</span>) - <span class="ruby-keyword kw">end</span> - - <span class="ruby-keyword kw">end</span> - <span class="ruby-keyword kw">end</span></pre> + <pre><span class="ruby-comment cmt"># File test/testhelper.rb, line 23</span> +<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file_cache</span> + <span class="ruby-ivar">@@filecache</span> +<span class="ruby-keyword kw">end</span></pre> </body> </html> \ No newline at end of file