codegram/resort — Issue #7: Rails 3.1 Support
Author: bjones
Created: 2011-12-08 03:01:01+00:00
State: open

I tried this out, there were originally 4 errors but 1 is easy to fix.

diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 5f6030e..1ea78f9 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,6 +1,12 @@
require 'rspec'

module Rails
+ class << self
+ # 3.0 defaults this, 3.1 does not
+ def application
+ "application"
+ end
+ end
end

require 'resort'

This patch takes care of an error in the migration test.

Still have 3 more errors, but I don't really see a logic issue here. Anyway if I figure it all out I'll send a pull request.

1) Resort::Sortable InstanceMethods#append_to appending 2 after 3 appends the element after another element
Failure/Error: article1.next.name.should == '3'
NoMethodError:
undefined method `name' for nil:NilClass
# ./spec/resort_spec.rb:361:in `block (5 levels) in '

2) Resort::Sortable InstanceMethods#append_to appending 2 after 4 appends the element after another element
Failure/Error: article1.next.name.should == '3'
NoMethodError:
undefined method `name' for nil:NilClass
# ./spec/resort_spec.rb:380:in `block (5 levels) in '

3) Resort::Sortable InstanceMethods#append_to appending 3 after 1 appends the element after another element
Failure/Error: article2.next.name.should == '4'
NoMethodError:
undefined method `name' for nil:NilClass
# ./spec/resort_spec.rb:413:in `block (5 levels) in '

Finished in 2.53 seconds
34 examples, 3 failures