Skip to content

Commit

Permalink
Fix broken tests. Remove spin as it only actually functions in rails …
Browse files Browse the repository at this point in the history
…apps.
  • Loading branch information
brianp committed Mar 1, 2012
1 parent 3985659 commit 5762598
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
1 change: 0 additions & 1 deletion Gemfile
Expand Up @@ -8,7 +8,6 @@ gem 'i18n' #Why doesn't activesupport require this?
group :development do
gem 'guard'
gem 'guard-rspec'
gem 'guard-spin'
end

gemspec
22 changes: 1 addition & 21 deletions Guardfile
@@ -1,24 +1,4 @@
guard 'bundler' do
watch('Gemfile')
# Uncomment next line if Gemfile contain `gemspec' command
# watch(/^.+\.gemspec/)
end

guard 'spin' do
# uses the .rspec file
# --colour --fail-fast --format documentation --tag ~slow
watch(%r{^spec/.+_spec\.rb})
watch(%r{^app/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.+)\.haml}) { |m| "spec/#{m[1]}.haml_spec.rb" }
watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
watch('Gemfile')
watch('Gemfile.lock')
watch('spec/spec_helper.rb')
watch('Guardfile')
end

guard 'rspec', :cli => "--color --order random", :version => 2, :rvm => ['1.9.3'] do
guard 'rspec', :cli => "--color --order random", :version => 2 do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
Expand Down
17 changes: 14 additions & 3 deletions spec/garnish/collection_spec.rb
Expand Up @@ -10,9 +10,20 @@
collection.relation.should eq(relation)
end

it "should pass the each method to the relation" do
relation.should_receive(:each)
collection.each
describe "the each method" do
let(:array) { stub(:array, :each => nil) }
before { collection.stub(:convert => array) }

it "should call to_a" do
relation.should_receive(:to_a).and_return(array)
collection.each
end

it "should call each on the resulting array" do
relation.stub(:to_a => array)
array.should_receive(:each)
collection.each
end
end

it "should pass the to_a method to the relation" do
Expand Down

0 comments on commit 5762598

Please sign in to comment.