Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 4b137326f38b5adf1f9ffd3dbbb48a7b > files > 757

deltacloud-core-doc-0.4.0-4.fc15.noarch.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>verify_url_for (DeltacloudUnitTest::UrlForTest)</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 tests/drivers/mock/url_for_test.rb, line 48</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verify_url_for</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">expected_url</span>, <span class="ruby-identifier">mode</span>=<span class="ruby-identifier">:path_only</span>, <span class="ruby-identifier">params</span>={}, <span class="ruby-identifier">rack_env</span>={})
      <span class="ruby-comment cmt"># generate a unique url for each test</span>
      <span class="ruby-identifier">test_url</span> = <span class="ruby-node">&quot;/url_for_test/#{expected_url.hash}/#{Time.now.to_i}&quot;</span>
      <span class="ruby-comment cmt"># Create our sinatra test endpoint</span>
      <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">create_test_url_content</span>(<span class="ruby-identifier">test_url</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">mode</span>)

      <span class="ruby-comment cmt"># verify the generated url matches what we expect</span>
      <span class="ruby-identifier">get</span> <span class="ruby-identifier">test_url</span>, <span class="ruby-identifier">params</span>, <span class="ruby-identifier">rack_env</span>
      <span class="ruby-identifier">last_response</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">should</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">expected_url</span>
    <span class="ruby-keyword kw">end</span></pre>
</body>
</html>