<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,4 @@
 /doc
 /rails
 *.gem
+/coverage</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -90,3 +90,12 @@ task :examples do
   %x(haml examples/index.haml examples/index.html)
   %x(sass examples/pagination.sass examples/pagination.css)
 end
+
+task :rcov do
+  excludes = %w( lib/will_paginate/named_scope*
+                 lib/will_paginate/core_ext.rb
+                 lib/will_paginate.rb
+                 rails* )
+  
+  system %[rcov -Itest:lib test/*.rb -x #{excludes.join(',')}]
+end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -226,9 +226,11 @@ module WillPaginate
       if window_to &gt; total_pages
         window_from -= window_to - total_pages
         window_to = total_pages
-      elsif window_from &lt; 1
+      end
+      if window_from &lt; 1
         window_to += 1 - window_from
         window_from = 1
+        window_to = total_pages if window_to &gt; total_pages
       end
       
       visible   = (1..total_pages).to_a
@@ -261,12 +263,8 @@ module WillPaginate
         stringified_merge @url_params, @options[:params] if @options[:params]
         
         if param_name.index(/[^\w-]/)
-          page_param = unless defined? CGIMethods
-            ActionController::AbstractRequest
-          else
-            # Rails 1.2
-            CGIMethods
-          end.parse_query_parameters(&quot;#{param_name}=#{page}&quot;)
+          page_param = (defined?(CGIMethods) ? CGIMethods : ActionController::AbstractRequest).
+            parse_query_parameters(&quot;#{param_name}=#{page}&quot;)
           
           stringified_merge @url_params, page_param
         else</diff>
      <filename>lib/will_paginate/view_helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -220,6 +220,8 @@ class FinderTest &lt; ActiveRecordTestCase
     assert_equal 2, entries.size
     assert_equal 2, entries.total_entries
   end
+
+  ## named_scope ##
   
   def test_paginate_in_named_scope
     entries = Developer.poor.paginate :page =&gt; 1, :per_page =&gt; 1
@@ -260,6 +262,15 @@ class FinderTest &lt; ActiveRecordTestCase
     end
   end
 
+  ## misc ##
+
+  def test_count_and_total_entries_options_are_mutually_exclusive
+    e = assert_raise ArgumentError do
+      Developer.paginate :page =&gt; 1, :count =&gt; {}, :total_entries =&gt; 1
+    end
+    assert_match /exclusive/, e.to_s
+  end
+  
   def test_readonly
     assert_nothing_raised { Developer.paginate :readonly =&gt; true, :page =&gt; 1 }
   end</diff>
      <filename>test/finder_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f48248f8900a94a50325c6330b12f161c1ed064f</id>
    </parent>
  </parents>
  <author>
    <name>Mislav Marohni&#263;</name>
    <email>mislav.marohnic@gmail.com</email>
  </author>
  <url>http://github.com/mattetti/will_paginate/commit/f4a23208344e28c1d89b9d1d2bd68729b7c01800</url>
  <id>f4a23208344e28c1d89b9d1d2bd68729b7c01800</id>
  <committed-date>2008-04-06T20:02:06-07:00</committed-date>
  <authored-date>2008-04-06T20:02:06-07:00</authored-date>
  <message>test with rcov and bring it up to 100% test coverage (yeah!!)</message>
  <tree>30230d605972e2e1a682ca5bc2bf3dfde87c9150</tree>
  <committer>
    <name>Mislav Marohni&#263;</name>
    <email>mislav.marohnic@gmail.com</email>
  </committer>
</commit>
