<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[177] trunk/spec: Gotta rename the spec, too</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>177</dd>
<dt>Author</dt> <dd>arex</dd>
<dt>Date</dt> <dd>2008-06-04 04:48:26 -0400 (Wed, 04 Jun 2008)</dd>
</dl>

<h3>Log Message</h3>
<pre>Gotta rename the spec, too</pre>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkspecbrowser_specrb">trunk/spec/browser_spec.rb</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkspecie_specrb">trunk/spec/ie_spec.rb</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkspecbrowser_specrbfromrev176trunkspecie_specrb"></a>
<div class="copfile"><h4>Copied: trunk/spec/browser_spec.rb (from rev 176, trunk/spec/ie_spec.rb) (0 => 177)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/spec/browser_spec.rb                                (rev 0)
+++ trunk/spec/browser_spec.rb        2008-06-04 08:48:26 UTC (rev 177)
</span><span class="lines">@@ -0,0 +1,226 @@
</span><ins>+require File.dirname(__FILE__) + '/spec_helper.rb'
+
+describe IE do
+  
+  before :all do
+    @browser = IE.new
+  end
+  
+  # Exists
+  describe &quot;#exists?&quot; do
+    it &quot;should return true if we are at a page&quot; do
+      @browser.should_not exist
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      @browser.should exist
+    end
+
+    it &quot;should return false after IE#close&quot; do
+      @browser.close
+      @browser.should_not exist
+    end
+  end
+  
+  describe &quot;#html&quot; do
+    it &quot;should return the html of the page&quot; do
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      @browser.html.should == File.read(File.dirname(__FILE__) + &quot;/html/non_control_elements.html&quot;)
+    end
+  end
+  
+  describe &quot;#title&quot; do
+    it &quot;should return the current page title&quot; do
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      @browser.title.should == &quot;Non-control elements&quot;
+    end
+  end
+
+  describe &quot;#text&quot; do
+    it &quot;should return the text of the page&quot; do
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      @browser.text.should include(&quot;Dubito, ergo cogito, ergo sum.&quot;)
+    end
+
+    it &quot;should return the text also if the content-type is text/plain&quot; do
+      # more specs for text/plain? what happens if we call other methods?
+      @browser.goto(TEST_HOST + &quot;/plain_text&quot;)
+      @browser.text.strip.should == 'This is text/plain'
+    end
+
+    it &quot;should return text in the correct charset (utf-8)&quot; do
+      @browser.goto(TEST_HOST + &quot;/utf8_text.html&quot;)
+      @browser.text.strip.should == &quot;\303\246\303\245\303\270&quot;
+    end
+
+    it &quot;should return text in the correct charset (latin-1)&quot; do
+      @browser.goto(TEST_HOST + &quot;/latin1_text.html&quot;)
+      @browser.text.strip.should == &quot;\370\345\346&quot;
+    end
+  end
+
+  describe &quot;#url&quot; do
+    it &quot;should return the current url&quot; do
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      @browser.url.should == TEST_HOST + &quot;/non_control_elements.html&quot;
+    end
+  end
+  
+  describe &quot;#document&quot; do
+    it &quot;should return the underlying object&quot; do
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      if RUBY_PLATFORM =~ /java/
+        @browser.document.should be_instance_of(Java::ComGargoylesoftwareHtmlunitHtml::HtmlHtml)
+      else 
+        @browser.document.should be_instance_of(WIN32OLE)
+      end
+    end
+  end
+  
+  # Show methods
+  describe &quot;#method_missing&quot; do
+    it &quot;should return all div elements on the page in a human readable format&quot; do
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      temp_stdout = StringIO.new
+      old_stdout = $stdout
+      $stdout = temp_stdout
+      begin
+        @browser.show_divs
+      ensure
+        $stdout = old_stdout
+      end
+      temp_stdout.string.should ==
+'Found 8 divs
+1: 
+2: id=&quot;outer_container&quot; 
+3: id=&quot;header&quot; title=&quot;Header and primary navigation&quot; class=&quot;profile&quot; 
+4: id=&quot;promo&quot; name=&quot;invalid_attribute&quot; value=&quot;invalid_attribute&quot; 
+5: id=&quot;content&quot; 
+6: id=&quot;best_language&quot; onclick=&quot;this.innerHTML = \'Ruby!\'&quot; style=&quot;color: red; text-decoration: underline; cursor: pointer;&quot; 
+7: id=&quot;html_test&quot; class=&quot;some_class&quot; title=&quot;This is a title&quot; 
+8: id=&quot;footer&quot; title=&quot;Closing remarks&quot; class=&quot;profile&quot; 
+'
+    end
+
+    it &quot;should raise NoMethodError if the collection does not exist&quot; do
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      lambda { @browser.show_no_such_collection }.should raise_error(NoMethodError)
+    end
+  end
+  
+  # Manipulation methods
+  describe &quot;.start&quot; do
+    it &quot;should go to the given URL and return an instance of itself&quot; do
+      @browser = Celerity::IE.start(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      @browser.should be_instance_of(Celerity::IE)
+      @browser.title.should == &quot;Non-control elements&quot;
+    end
+  end
+  
+  describe &quot;#goto&quot; do
+    # waiting for JRuby OpenSSL
+    # it &quot;should handle HTTPS&quot; do
+    #   pending
+    # end
+
+    it &quot;should go to the given url without raising errors&quot; do
+      lambda { @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;) }.should_not raise_error
+    end
+  end
+  
+  describe &quot;#refresh&quot; do
+    it &quot;should refresh the page&quot; do
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      @browser.span(:name, 'footer').click
+      @browser.span(:name, 'footer').text.should include('Javascript')
+      @browser.refresh
+      @browser.span(:name, 'footer').text.should_not include('Javascript')
+    end
+  end
+  
+  describe &quot;#execute_script&quot; do
+    it &quot;should execute the given JavaScript on the current page&quot; do
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      @browser.pre(:id, 'rspec').text.should_not == &quot;javascript text&quot;
+      @browser.execute_script(&quot;document.getElementById('rspec').innerHTML = 'javascript text'&quot;)
+      @browser.pre(:id, 'rspec').text.should == &quot;javascript text&quot;
+    end
+  end
+  
+  describe &quot;#back&quot; do
+    it &quot;should go to the previous page&quot; do
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      orig_url = @browser.url
+      @browser.goto(TEST_HOST + &quot;/tables.html&quot;)
+      new_url = @browser.url
+      orig_url.should_not == new_url
+      @browser.back
+      orig_url.should == @browser.url
+    end
+  end
+  
+  # Other
+  describe &quot;#contains_text&quot; do
+    before :each do
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+    end
+
+    it &quot;should raise ArgumentError when called with no or wrong arguments&quot; do
+      lambda { @browser.contains_text }.should raise_error(ArgumentError)
+      lambda { @browser.contains_text(nil) }.should raise_error(ArgumentError)
+      lambda { @browser.contains_text(42) }.should raise_error(ArgumentError)
+    end
+
+    it &quot;should return the index if the given text exists&quot; do
+        @browser.contains_text('Dubito, ergo cogito, ergo sum.').should be_instance_of(Fixnum)
+        @browser.contains_text(/Dubito.*sum./).should_not be_nil
+    end
+
+    it &quot;should return nil if the text doesn't exist&quot; do
+      @browser.contains_text('no_such_text').should be_nil
+      @browser.contains_text(/no_such_text/).should be_nil
+    end
+
+    it &quot;should not raise error on a blank page&quot; do
+      @browser = IE.new
+      lambda { @browser.contains_text('') }.should_not raise_error
+    end
+  end
+  
+  describe &quot;#add_checker&quot; do
+    it &quot;should raise ArgumentError when not given any arguments&quot; do
+      lambda { @browser.add_checker }.should raise_error(ArgumentError)
+    end
+
+    it &quot;should run the given proc on each page load&quot; do
+      output = ''
+      proc = Proc.new { |ie| output &lt;&lt; ie.text }
+      @browser.add_checker(proc)
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      output.should include('Dubito, ergo cogito, ergo sum')
+    end
+
+    it &quot;should run the given block on each page load&quot; do
+      output = ''
+      @browser.add_checker { |ie| output &lt;&lt; ie.text }
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      output.should include('Dubito, ergo cogito, ergo sum')
+    end
+  end
+  
+  describe &quot;#disable_checker&quot; do
+    it &quot;should remove a previously added checker&quot; do
+      output = ''
+      checker = lambda { |ie| output &lt;&lt; ie.text }
+      @browser.add_checker(checker)
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      output.should include('Dubito, ergo cogito, ergo sum')
+      @browser.disable_checker(checker)
+      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
+      output.should include('Dubito, ergo cogito, ergo sum')
+    end
+  end
+
+  after :all do
+    @browser.close
+  end
+
+end
</ins></span></pre></div>
<a id="trunkspecie_specrb"></a>
<div class="delfile"><h4>Deleted: trunk/spec/ie_spec.rb (176 => 177)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/spec/ie_spec.rb        2008-06-03 13:57:57 UTC (rev 176)
+++ trunk/spec/ie_spec.rb        2008-06-04 08:48:26 UTC (rev 177)
</span><span class="lines">@@ -1,226 +0,0 @@
</span><del>-require File.dirname(__FILE__) + '/spec_helper.rb'
-
-describe IE do
-  
-  before :all do
-    @browser = IE.new
-  end
-  
-  # Exists
-  describe &quot;#exists?&quot; do
-    it &quot;should return true if we are at a page&quot; do
-      @browser.should_not exist
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      @browser.should exist
-    end
-
-    it &quot;should return false after IE#close&quot; do
-      @browser.close
-      @browser.should_not exist
-    end
-  end
-  
-  describe &quot;#html&quot; do
-    it &quot;should return the html of the page&quot; do
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      @browser.html.should == File.read(File.dirname(__FILE__) + &quot;/html/non_control_elements.html&quot;)
-    end
-  end
-  
-  describe &quot;#title&quot; do
-    it &quot;should return the current page title&quot; do
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      @browser.title.should == &quot;Non-control elements&quot;
-    end
-  end
-
-  describe &quot;#text&quot; do
-    it &quot;should return the text of the page&quot; do
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      @browser.text.should include(&quot;Dubito, ergo cogito, ergo sum.&quot;)
-    end
-
-    it &quot;should return the text also if the content-type is text/plain&quot; do
-      # more specs for text/plain? what happens if we call other methods?
-      @browser.goto(TEST_HOST + &quot;/plain_text&quot;)
-      @browser.text.strip.should == 'This is text/plain'
-    end
-
-    it &quot;should return text in the correct charset (utf-8)&quot; do
-      @browser.goto(TEST_HOST + &quot;/utf8_text.html&quot;)
-      @browser.text.strip.should == &quot;\303\246\303\245\303\270&quot;
-    end
-
-    it &quot;should return text in the correct charset (latin-1)&quot; do
-      @browser.goto(TEST_HOST + &quot;/latin1_text.html&quot;)
-      @browser.text.strip.should == &quot;\370\345\346&quot;
-    end
-  end
-
-  describe &quot;#url&quot; do
-    it &quot;should return the current url&quot; do
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      @browser.url.should == TEST_HOST + &quot;/non_control_elements.html&quot;
-    end
-  end
-  
-  describe &quot;#document&quot; do
-    it &quot;should return the underlying object&quot; do
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      if RUBY_PLATFORM =~ /java/
-        @browser.document.should be_instance_of(Java::ComGargoylesoftwareHtmlunitHtml::HtmlHtml)
-      else 
-        @browser.document.should be_instance_of(WIN32OLE)
-      end
-    end
-  end
-  
-  # Show methods
-  describe &quot;#method_missing&quot; do
-    it &quot;should return all div elements on the page in a human readable format&quot; do
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      temp_stdout = StringIO.new
-      old_stdout = $stdout
-      $stdout = temp_stdout
-      begin
-        @browser.show_divs
-      ensure
-        $stdout = old_stdout
-      end
-      temp_stdout.string.should ==
-'Found 8 divs
-1: 
-2: id=&quot;outer_container&quot; 
-3: id=&quot;header&quot; title=&quot;Header and primary navigation&quot; class=&quot;profile&quot; 
-4: id=&quot;promo&quot; name=&quot;invalid_attribute&quot; value=&quot;invalid_attribute&quot; 
-5: id=&quot;content&quot; 
-6: id=&quot;best_language&quot; onclick=&quot;this.innerHTML = \'Ruby!\'&quot; style=&quot;color: red; text-decoration: underline; cursor: pointer;&quot; 
-7: id=&quot;html_test&quot; class=&quot;some_class&quot; title=&quot;This is a title&quot; 
-8: id=&quot;footer&quot; title=&quot;Closing remarks&quot; class=&quot;profile&quot; 
-'
-    end
-
-    it &quot;should raise NoMethodError if the collection does not exist&quot; do
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      lambda { @browser.show_no_such_collection }.should raise_error(NoMethodError)
-    end
-  end
-  
-  # Manipulation methods
-  describe &quot;.start&quot; do
-    it &quot;should go to the given URL and return an instance of itself&quot; do
-      @browser = Celerity::IE.start(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      @browser.should be_instance_of(Celerity::IE)
-      @browser.title.should == &quot;Non-control elements&quot;
-    end
-  end
-  
-  describe &quot;#goto&quot; do
-    # waiting for JRuby OpenSSL
-    # it &quot;should handle HTTPS&quot; do
-    #   pending
-    # end
-
-    it &quot;should go to the given url without raising errors&quot; do
-      lambda { @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;) }.should_not raise_error
-    end
-  end
-  
-  describe &quot;#refresh&quot; do
-    it &quot;should refresh the page&quot; do
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      @browser.span(:name, 'footer').click
-      @browser.span(:name, 'footer').text.should include('Javascript')
-      @browser.refresh
-      @browser.span(:name, 'footer').text.should_not include('Javascript')
-    end
-  end
-  
-  describe &quot;#execute_script&quot; do
-    it &quot;should execute the given JavaScript on the current page&quot; do
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      @browser.pre(:id, 'rspec').text.should_not == &quot;javascript text&quot;
-      @browser.execute_script(&quot;document.getElementById('rspec').innerHTML = 'javascript text'&quot;)
-      @browser.pre(:id, 'rspec').text.should == &quot;javascript text&quot;
-    end
-  end
-  
-  describe &quot;#back&quot; do
-    it &quot;should go to the previous page&quot; do
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      orig_url = @browser.url
-      @browser.goto(TEST_HOST + &quot;/tables.html&quot;)
-      new_url = @browser.url
-      orig_url.should_not == new_url
-      @browser.back
-      orig_url.should == @browser.url
-    end
-  end
-  
-  # Other
-  describe &quot;#contains_text&quot; do
-    before :each do
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-    end
-
-    it &quot;should raise ArgumentError when called with no or wrong arguments&quot; do
-      lambda { @browser.contains_text }.should raise_error(ArgumentError)
-      lambda { @browser.contains_text(nil) }.should raise_error(ArgumentError)
-      lambda { @browser.contains_text(42) }.should raise_error(ArgumentError)
-    end
-
-    it &quot;should return the index if the given text exists&quot; do
-        @browser.contains_text('Dubito, ergo cogito, ergo sum.').should be_instance_of(Fixnum)
-        @browser.contains_text(/Dubito.*sum./).should_not be_nil
-    end
-
-    it &quot;should return nil if the text doesn't exist&quot; do
-      @browser.contains_text('no_such_text').should be_nil
-      @browser.contains_text(/no_such_text/).should be_nil
-    end
-
-    it &quot;should not raise error on a blank page&quot; do
-      @browser = IE.new
-      lambda { @browser.contains_text('') }.should_not raise_error
-    end
-  end
-  
-  describe &quot;#add_checker&quot; do
-    it &quot;should raise ArgumentError when not given any arguments&quot; do
-      lambda { @browser.add_checker }.should raise_error(ArgumentError)
-    end
-
-    it &quot;should run the given proc on each page load&quot; do
-      output = ''
-      proc = Proc.new { |ie| output &lt;&lt; ie.text }
-      @browser.add_checker(proc)
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      output.should include('Dubito, ergo cogito, ergo sum')
-    end
-
-    it &quot;should run the given block on each page load&quot; do
-      output = ''
-      @browser.add_checker { |ie| output &lt;&lt; ie.text }
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      output.should include('Dubito, ergo cogito, ergo sum')
-    end
-  end
-  
-  describe &quot;#disable_checker&quot; do
-    it &quot;should remove a previously added checker&quot; do
-      output = ''
-      checker = lambda { |ie| output &lt;&lt; ie.text }
-      @browser.add_checker(checker)
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      output.should include('Dubito, ergo cogito, ergo sum')
-      @browser.disable_checker(checker)
-      @browser.goto(TEST_HOST + &quot;/non_control_elements.html&quot;)
-      output.should include('Dubito, ergo cogito, ergo sum')
-    end
-  end
-
-  after :all do
-    @browser.close
-  end
-
-end
</del></span></pre>
</div>
</div>

</body>
</html>