Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleanup the plugin checkouts.

  • Loading branch information...
commit 992de8e77cdc23e3a006887a1eb6a91c482555b3 1 parent 8d69c19
@alloy authored
Showing with 2 additions and 1,568 deletions.
  1. +2 −1  .gitignore
  2. +0 −29 vendor/plugins/has_autosave_and_nested_params/.svn/all-wcprops
  3. +0 −82 vendor/plugins/has_autosave_and_nested_params/.svn/entries
  4. +0 −1  vendor/plugins/has_autosave_and_nested_params/.svn/format
  5. +0 −20 vendor/plugins/has_autosave_and_nested_params/.svn/text-base/MIT-LICENSE.svn-base
  6. +0 −31 vendor/plugins/has_autosave_and_nested_params/.svn/text-base/README.svn-base
  7. +0 −22 vendor/plugins/has_autosave_and_nested_params/.svn/text-base/Rakefile.svn-base
  8. +0 −2  vendor/plugins/has_autosave_and_nested_params/.svn/text-base/TODO.svn-base
  9. +0 −17 vendor/plugins/has_autosave_and_nested_params/lib/.svn/all-wcprops
  10. +0 −52 vendor/plugins/has_autosave_and_nested_params/lib/.svn/entries
  11. +0 −1  vendor/plugins/has_autosave_and_nested_params/lib/.svn/format
  12. +0 −86 vendor/plugins/has_autosave_and_nested_params/lib/.svn/text-base/autosave_association.rb.svn-base
  13. +0 −106 vendor/plugins/has_autosave_and_nested_params/lib/.svn/text-base/nested_params.rb.svn-base
  14. +0 −23 vendor/plugins/has_autosave_and_nested_params/test/.svn/all-wcprops
  15. +0 −64 vendor/plugins/has_autosave_and_nested_params/test/.svn/entries
  16. +0 −1  vendor/plugins/has_autosave_and_nested_params/test/.svn/format
  17. +0 −65 vendor/plugins/has_autosave_and_nested_params/test/.svn/text-base/autosave_association_test.rb.svn-base
  18. +0 −134 vendor/plugins/has_autosave_and_nested_params/test/.svn/text-base/nested_params_test.rb.svn-base
  19. +0 −65 vendor/plugins/has_autosave_and_nested_params/test/.svn/text-base/test_helper.rb.svn-base
  20. +0 −17 vendor/plugins/on_test_spec/.svn/all-wcprops
  21. +0 −58 vendor/plugins/on_test_spec/.svn/entries
  22. +0 −1  vendor/plugins/on_test_spec/.svn/format
  23. +0 −20 vendor/plugins/on_test_spec/.svn/text-base/LICENSE.svn-base
  24. +0 −4 vendor/plugins/on_test_spec/.svn/text-base/README.svn-base
  25. +0 −5 vendor/plugins/on_test_spec/lib/.svn/all-wcprops
  26. +0 −31 vendor/plugins/on_test_spec/lib/.svn/entries
  27. +0 −1  vendor/plugins/on_test_spec/lib/.svn/format
  28. +0 −5 vendor/plugins/on_test_spec/lib/test/.svn/all-wcprops
  29. +0 −31 vendor/plugins/on_test_spec/lib/test/.svn/entries
  30. +0 −1  vendor/plugins/on_test_spec/lib/test/.svn/format
  31. +0 −17 vendor/plugins/on_test_spec/lib/test/spec/.svn/all-wcprops
  32. +0 −55 vendor/plugins/on_test_spec/lib/test/spec/.svn/entries
  33. +0 −1  vendor/plugins/on_test_spec/lib/test/spec/.svn/format
  34. +0 −19 vendor/plugins/on_test_spec/lib/test/spec/.svn/text-base/rails.rb.svn-base
  35. +0 −48 vendor/plugins/on_test_spec/lib/test/spec/.svn/text-base/share.rb.svn-base
  36. +0 −41 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/all-wcprops
  37. +0 −100 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/entries
  38. +0 −1  vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/format
  39. +0 −32 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/controller_helpers.rb.svn-base
  40. +0 −86 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/expectations.rb.svn-base
  41. +0 −11 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/request_helpers.rb.svn-base
  42. +0 −42 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/response_helpers.rb.svn-base
  43. +0 −12 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/spec_responder.rb.svn-base
  44. +0 −23 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/test_spec_ext.rb.svn-base
  45. +0 −11 vendor/plugins/on_test_spec/test/.svn/all-wcprops
  46. +0 −40 vendor/plugins/on_test_spec/test/.svn/entries
  47. +0 −1  vendor/plugins/on_test_spec/test/.svn/format
  48. +0 −52 vendor/plugins/on_test_spec/test/.svn/text-base/share_test.rb.svn-base
View
3  .gitignore
@@ -1,4 +1,5 @@
log/*
tmp/*
*.sqlite3
-.svn
+.svn
+.DS_Store
View
29 vendor/plugins/has_autosave_and_nested_params/.svn/all-wcprops
@@ -1,29 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 73
-/svn/aac/!svn/ver/404/trunk/vendor/plugins/has_autosave_and_nested_params
-END
-Rakefile
-K 25
-svn:wc:ra_dav:version-url
-V 82
-/svn/aac/!svn/ver/402/trunk/vendor/plugins/has_autosave_and_nested_params/Rakefile
-END
-TODO
-K 25
-svn:wc:ra_dav:version-url
-V 78
-/svn/aac/!svn/ver/404/trunk/vendor/plugins/has_autosave_and_nested_params/TODO
-END
-MIT-LICENSE
-K 25
-svn:wc:ra_dav:version-url
-V 85
-/svn/aac/!svn/ver/402/trunk/vendor/plugins/has_autosave_and_nested_params/MIT-LICENSE
-END
-README
-K 25
-svn:wc:ra_dav:version-url
-V 80
-/svn/aac/!svn/ver/402/trunk/vendor/plugins/has_autosave_and_nested_params/README
-END
View
82 vendor/plugins/has_autosave_and_nested_params/.svn/entries
@@ -1,82 +0,0 @@
-8
-
-dir
-430
-https://fngtps.com/svn/aac/trunk/vendor/plugins/has_autosave_and_nested_params
-https://fngtps.com/svn/aac
-
-
-
-2008-08-18T10:56:08.309364Z
-404
-eloy
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-e28ea3b4-8fe9-4f9d-8917-340b98aa425c
-
-test
-dir
-
-Rakefile
-file
-
-
-
-
-2008-08-19T18:21:14.000000Z
-9dd09af4763b946ff71a633d143b14b6
-2008-08-16T12:03:36.591417Z
-402
-eloy
-
-TODO
-file
-
-
-
-
-2008-08-19T18:21:14.000000Z
-ddb74bdb4b65d5a1b0f5018776717134
-2008-08-18T10:56:08.309364Z
-404
-eloy
-
-lib
-dir
-
-MIT-LICENSE
-file
-
-
-
-
-2008-08-19T18:21:14.000000Z
-e28f35a0e99fcc29c0f8f9f79b1df7f5
-2008-08-16T12:03:36.591417Z
-402
-eloy
-
-README
-file
-
-
-
-
-2008-08-19T18:21:14.000000Z
-624d5f006d413ae5700d4f55931238cb
-2008-08-16T12:03:36.591417Z
-402
-eloy
-
View
1  vendor/plugins/has_autosave_and_nested_params/.svn/format
@@ -1 +0,0 @@
-8
View
20 vendor/plugins/has_autosave_and_nested_params/.svn/text-base/MIT-LICENSE.svn-base
@@ -1,20 +0,0 @@
-Copyright (c) 2008 Eloy Duran <eloy@fngtps.com>
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
31 vendor/plugins/has_autosave_and_nested_params/.svn/text-base/README.svn-base
@@ -1,31 +0,0 @@
-== AutosaveAssociation
-Adds :autosave to the options for has_one and has_many associations,
-which will automatically save the associated models after
-the parent has been saved.
-
-== NestedParams
-Adds :nested_params to the options for has_one and has_many associations,
-which allows attributes of the associated model to be set directly
-with a hash to #attributes=.
-
-=== License
-Copyright (c) 2008 Eloy Duran <eloy@fngtps.com>
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
22 vendor/plugins/has_autosave_and_nested_params/.svn/text-base/Rakefile.svn-base
@@ -1,22 +0,0 @@
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-desc 'Default: run unit tests.'
-task :default => :test
-
-desc 'Test the has_autosave_and_nested_params plugin.'
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = true
-end
-
-desc 'Generate documentation for the has_autosave_and_nested_params plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'HasAutosaveAndNestedParams'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
View
2  vendor/plugins/has_autosave_and_nested_params/.svn/text-base/TODO.svn-base
@@ -1,2 +0,0 @@
-AutosaveAssociation:
-- Add validation for has_many
View
17 vendor/plugins/has_autosave_and_nested_params/lib/.svn/all-wcprops
@@ -1,17 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 77
-/svn/aac/!svn/ver/404/trunk/vendor/plugins/has_autosave_and_nested_params/lib
-END
-autosave_association.rb
-K 25
-svn:wc:ra_dav:version-url
-V 101
-/svn/aac/!svn/ver/404/trunk/vendor/plugins/has_autosave_and_nested_params/lib/autosave_association.rb
-END
-nested_params.rb
-K 25
-svn:wc:ra_dav:version-url
-V 94
-/svn/aac/!svn/ver/402/trunk/vendor/plugins/has_autosave_and_nested_params/lib/nested_params.rb
-END
View
52 vendor/plugins/has_autosave_and_nested_params/lib/.svn/entries
@@ -1,52 +0,0 @@
-8
-
-dir
-430
-https://fngtps.com/svn/aac/trunk/vendor/plugins/has_autosave_and_nested_params/lib
-https://fngtps.com/svn/aac
-
-
-
-2008-08-18T10:56:08.309364Z
-404
-eloy
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-e28ea3b4-8fe9-4f9d-8917-340b98aa425c
-
-autosave_association.rb
-file
-
-
-
-
-2008-08-19T18:21:14.000000Z
-f64d7ba35cd895d83c52731210a1b269
-2008-08-18T10:56:08.309364Z
-404
-eloy
-
-nested_params.rb
-file
-
-
-
-
-2008-08-19T18:21:14.000000Z
-4766b79eff8cf9a597b0f385d1766321
-2008-08-16T12:03:36.591417Z
-402
-eloy
-
View
1  vendor/plugins/has_autosave_and_nested_params/lib/.svn/format
@@ -1 +0,0 @@
-8
View
86 vendor/plugins/has_autosave_and_nested_params/lib/.svn/text-base/autosave_association.rb.svn-base
@@ -1,86 +0,0 @@
-# Adds :autosave to the options for has_one and has_many associations,
-# which will automatically save the associated models after
-# the parent has been saved.
-#
-# Example of a has_one association:
-#
-# class Member < ActiveRecord::Base
-# extend AutosaveAssociation
-# has_one :avatar, :autosave => true
-# end
-#
-# member.avatar.name # => 'smiley'
-# member.avatar.name = 'sadly'
-#
-# member.save
-# member.reload
-#
-# member.avatar.name # => 'sadly'
-#
-# Example of a has_many association:
-#
-# class Member < ActiveRecord::Base
-# extend AutosaveAssociation
-# has_many :avatars, :autosave => true
-# end
-#
-# member.avatars.map(&:name) # => ['smiley', 'frowny']
-#
-# member.avatars.first.name = 'sadley'
-# member.avatars.last.name = 'browny'
-#
-# member.save
-# member.reload
-#
-# member.avatars.map(&:name) # => ['sadley', 'browny']
-module AutosaveAssociation
- def has_many_with_autosave(*args)
- autosave = args.last.delete(:autosave) if args.last.is_a?(Hash)
- has_many_without_autosave(*args)
- define_autosave_for_has_many_association(args.first) if autosave
- end
-
- def define_autosave_for_has_many_association(attr)
- class_eval do
- define_method("autosave_#{attr}") do
- send(attr).each { |x| x.save }
- end
- after_save "autosave_#{attr}"
- end
- end
-
- def has_one_with_autosave(*args)
- autosave = args.last.delete(:autosave) if args.last.is_a?(Hash)
- has_one_without_autosave(*args)
- define_autosave_for_has_one_association(args.first) if autosave
- end
-
- # Defines the method that will save the association after the model is saved.
- # Also defines a validation method for the association which will add any errors
- # of the association to the models errors.
- def define_autosave_for_has_one_association(attr)
- class_eval do
- define_method("autosave_#{attr}") do
- if associated_model = send(attr)
- associated_model.save
- end
- end
- after_save "autosave_#{attr}"
-
- define_method("validate_#{attr}") do
- if (associated_model = send(attr)) and not associated_model.valid?
- associated_model.errors.each { |attribute, message| errors.add attribute, message }
- end
- end
- validate "validate_#{attr}"
- end
- end
-
- def self.extended(klass)
- return if klass.respond_to? :has_one_without_autosave
- class << klass
- alias_method_chain :has_many, :autosave
- alias_method_chain :has_one, :autosave
- end
- end
-end
View
106 vendor/plugins/has_autosave_and_nested_params/lib/.svn/text-base/nested_params.rb.svn-base
@@ -1,106 +0,0 @@
-require File.expand_path('../autosave_association', __FILE__)
-
-# Adds :nested_params to the options for has_one and has_many associations,
-# which allows attributes of the associated model to be set directly
-# with a hash to #attributes=.
-#
-# This is handy for when you have a form consisting of a parent and one or more child records.
-#
-# All the associations that you enable :nested_params on, will automatically have :autosave turned on as well.
-# See AutosaveAssociation for more info.
-#
-# Example of a has_one association:
-#
-# class Member < ActiveRecord::Base
-# extend NestedParams
-# has_one :avatar, :nested_params => true
-# end
-#
-# params[:member] # => { 'name' => 'joe', 'avatar' => { 'name' => 'sadly' }}
-#
-# member.update_attributes params[:member]
-# member.reload;
-#
-# member.avatar.name # => 'sadly'
-#
-# Example of a has_many association:
-#
-# class Member < ActiveRecord::Base
-# extend NestedParams
-# has_many :avatars, :nested_params => true
-# end
-#
-# params[:member] # => { 'name' => 'joe', 'avatars' => { '1' => { 'name' => 'sadly' }, '2' => { 'name' => 'smiley' }}}
-# member.update_attributes params[:member]
-#
-# Avatar.find(1).name # => 'sadly'
-# Avatar.find(2).name # => 'smiley'
-module NestedParams
- def has_many_with_nested_params(*args)
- nested_params = args.last.delete(:nested_params) if args.last.is_a?(Hash)
- has_many_without_nested_params(*args)
- if nested_params
- attr = args.first
- define_nested_params_for_has_many_association(attr)
- define_autosave_for_has_many_association(attr)
- end
- end
-
- def define_nested_params_for_has_many_association(attr)
- class_eval do
- define_method("#{attr}_with_nested_params=") do |value|
- if value.is_a? Hash
- # For existing records
- value.each do |id, attributes|
- send(attr).detect { |x| x.id == id.to_i }.attributes = attributes
- end
- else
- if value.is_a?(Array) && value.all? { |x| x.is_a?(Hash) }
- # For new records
- value.each do |attributes|
- send(attr).build attributes
- end
- else
- # For existing instaniated records and all other stuff people might pass
- send("#{attr}_without_nested_params=", value)
- end
- end
- end
- end
-
- alias_method_chain("#{attr}=", :nested_params)
- end
-
- def has_one_with_nested_params(*args)
- nested_params = args.last.delete(:nested_params) if args.last.is_a?(Hash)
- has_one_without_nested_params(*args)
- if nested_params
- attr = args.first
- define_nested_params_for_has_one_association(attr)
- define_autosave_for_has_one_association(attr)
- end
- end
-
- def define_nested_params_for_has_one_association(attr)
- class_eval do
- define_method("#{attr}_with_nested_params=") do |value|
- if value.is_a? Hash
- send("build_#{attr}") if send(attr).nil?
- send(attr).attributes = value
- else
- send("#{attr}_without_nested_params=", value)
- end
- end
- end
-
- alias_method_chain("#{attr}=", :nested_params)
- end
-
- def self.extended(klass)
- klass.extend AutosaveAssociation
- class << klass
- alias_method_chain :has_many, :nested_params
- alias_method_chain :has_one, :nested_params
- end
- end
-end
View
23 vendor/plugins/has_autosave_and_nested_params/test/.svn/all-wcprops
@@ -1,23 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 78
-/svn/aac/!svn/ver/404/trunk/vendor/plugins/has_autosave_and_nested_params/test
-END
-test_helper.rb
-K 25
-svn:wc:ra_dav:version-url
-V 93
-/svn/aac/!svn/ver/404/trunk/vendor/plugins/has_autosave_and_nested_params/test/test_helper.rb
-END
-autosave_association_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 107
-/svn/aac/!svn/ver/404/trunk/vendor/plugins/has_autosave_and_nested_params/test/autosave_association_test.rb
-END
-nested_params_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 100
-/svn/aac/!svn/ver/404/trunk/vendor/plugins/has_autosave_and_nested_params/test/nested_params_test.rb
-END
View
64 vendor/plugins/has_autosave_and_nested_params/test/.svn/entries
@@ -1,64 +0,0 @@
-8
-
-dir
-430
-https://fngtps.com/svn/aac/trunk/vendor/plugins/has_autosave_and_nested_params/test
-https://fngtps.com/svn/aac
-
-
-
-2008-08-18T10:56:08.309364Z
-404
-eloy
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-e28ea3b4-8fe9-4f9d-8917-340b98aa425c
-
-test_helper.rb
-file
-
-
-
-
-2008-08-19T18:21:14.000000Z
-250953a7a3bcda66a8a22b61eb7c9dff
-2008-08-18T10:56:08.309364Z
-404
-eloy
-
-autosave_association_test.rb
-file
-
-
-
-
-2008-08-19T18:21:14.000000Z
-9e80cfdb056f4d0316a1e9d262240362
-2008-08-18T10:56:08.309364Z
-404
-eloy
-
-nested_params_test.rb
-file
-
-
-
-
-2008-08-19T18:21:14.000000Z
-ef0159ab8c854cd9fa73a34b385cf52c
-2008-08-18T10:56:08.309364Z
-404
-eloy
-
View
1  vendor/plugins/has_autosave_and_nested_params/test/.svn/format
@@ -1 +0,0 @@
-8
View
65 vendor/plugins/has_autosave_and_nested_params/test/.svn/text-base/autosave_association_test.rb.svn-base
@@ -1,65 +0,0 @@
-require File.expand_path('../test_helper', __FILE__)
-
-describe "AutosaveAssociation, on a has_one association" do
- before do
- setup_db
-
- @member = Member.create(:email => 'paco@example.com')
- @avatar = @member.create_avatar(:name => 'smiley')
- end
-
- after do
- teardown_db
- end
-
- it "should still work as normal" do
- @member.email = 'pablo@example.com'
- @member.save!; @member.reload
- @member.email.should == 'pablo@example.com'
- end
-
- it "should also still work without an associated model" do
- member = Member.create(:email => '')
- member.email = 'pablo@example.com'
- lambda { member.save! }.should.not.raise Exception
- end
-
- it "should automatically save the associated model" do
- @member.avatar.name = 'sadly'
- @member.save!; @member.reload
- @member.avatar.name.should == 'sadly'
- end
-
- it "should automatically validate the associated model" do
- @member.avatar.name = ''
- @member.should.not.be.valid
- @member.errors.on(:name).should.not.be.blank
- end
-end
-
-describe "AutosaveAssociation, on a has_many association" do
- before do
- setup_db
-
- @visitor = Visitor.create(:email => 'paco@example.com')
- @avatar1 = @visitor.avatars.create(:name => 'smiley1')
- @avatar2 = @visitor.avatars.create(:name => 'smiley2')
- end
-
- after do
- teardown_db
- end
-
- it "should still work as normal" do
- @visitor.attributes = { :email => 'pablo@example.com' }
- @visitor.email.should == 'pablo@example.com'
- end
-
- it "should automatically save the associated models" do
- @avatar1.name = 'sadly1'
- @avatar2.name = 'sadly2'
- @visitor.save!; @visitor.reload
-
- @visitor.avatars.map(&:name).sort.should == %w{ sadly1 sadly2 }
- end
-end
View
134 vendor/plugins/has_autosave_and_nested_params/test/.svn/text-base/nested_params_test.rb.svn-base
@@ -1,134 +0,0 @@
-require File.expand_path('../test_helper', __FILE__)
-
-describe "NestedParams, on a has_many association" do
- before do
- setup_db
-
- @visitor = Visitor.create(:email => 'paco@example.com')
- @artist1 = @visitor.artists.create(:name => 'paco')
- @artist2 = @visitor.artists.create(:name => 'poncho')
- end
-
- after do
- teardown_db
- end
-
- it "should still work as normal" do
- @visitor.artists = [@artist1]
- @visitor.save!; @visitor.reload
- @visitor.artists.should == [@artist1]
- end
-
- it "should take a hash and assign the attributes to the associated models" do
- @visitor.attributes = {
- :artists => {
- @artist1.id.to_s => { :name => 'joe' },
- @artist2.id.to_s => { :name => 'jack' }
- }
- }
-
- @visitor.artists.map(&:name).sort.should == %w{ jack joe }
- end
-
- it "should automatically enable autosave on the association" do
- @visitor.attributes = {
- :artists => {
- @artist1.id.to_s => { :name => 'joe' },
- @artist2.id.to_s => { :name => 'jack' }
- }
- }
- @visitor.save!; @visitor.reload
-
- @visitor.artists.map(&:name).sort.should == %w{ jack joe }
- end
-
- it "should automatically build a new associated model if there is none" do
- @visitor.artists.destroy_all; @visitor.reload
- @visitor.attributes = { :artists => [{ :name => 'Pablo' }, { :name => 'Paco' }] }
-
- @visitor.artists.first.should.be.new_record
- @visitor.artists.first.name.should == 'Pablo'
-
- @visitor.artists.last.should.be.new_record
- @visitor.artists.last.name.should == 'Paco'
- end
-
- it "should work with update_attributes as well" do
- @visitor.update_attributes({
- :artists => {
- @artist1.id.to_s => { :name => 'joe' },
- @artist2.id.to_s => { :name => 'jack' }
- }
- })
- @visitor.reload
- @visitor.artists.map(&:name).sort.should == %w{ jack joe }
- end
-end
-
-describe "NestedParams, on a has_one association" do
- before do
- setup_db
-
- @member = Member.create(:email => 'paco@example.com')
- @artist = @member.create_artist(:name => 'Mister Paco')
- end
-
- after do
- teardown_db
- end
-
- it "should still work as normal" do
- @member.artist = Artist.new(:name => 'Poncho')
- @member.artist.name.should == 'Poncho'
- end
-
- it "should take a hash and assign the attributes to the associated model" do
- @member.attributes = { :email => 'pablo@example.com', :artist => { :name => 'Pablo' } }
- @member.email.should == 'pablo@example.com'
- @member.artist.name.should == 'Pablo'
- end
-
- it "should also work with a HashWithIndifferentAccess" do
- @member.attributes = HashWithIndifferentAccess.new(:email => 'pablo@example.com', :artist => HashWithIndifferentAccess.new(:name => 'Pablo'))
- @member.email.should == 'pablo@example.com'
- @member.artist.name.should == 'Pablo'
- end
-
- it "should work with update_attributes as well" do
- @member.update_attributes({ :email => 'pablo@example.com', :artist => { :name => 'Pablo' } })
- @member.reload
- @member.artist.name.should == 'Pablo'
- end
-
- it "should automatically instantiate an associated model if there is none" do
- @artist.destroy; @member.reload
- @member.attributes = { :artist => { :name => 'Pablo' } }
-
- @member.artist.should.be.new_record
- @member.artist.name.should == 'Pablo'
- end
-
- it "should automatically extend the model class with the AutosaveAssociation module" do
- klass = Class.new do
- class << self
- def has_one(*args); end
- def has_many(*args); end
- end
-
- extend NestedParams
- end
- (class << klass; self; end).should.include AutosaveAssociation
- end
-
- it "should automatically enable autosave on the association" do
- @member.attributes = { :email => 'pablo@example.com', :artist => { :name => 'Pablo' } }
- @member.save!; @member.reload
- @member.artist.name.should == 'Pablo'
- end
-
- it "should automatically validate the associated model" do
- @member.artist.name = ''
- @member.should.not.be.valid
- @member.errors.on(:name).should.not.be.blank
- end
-end
View
65 vendor/plugins/has_autosave_and_nested_params/test/.svn/text-base/test_helper.rb.svn-base
@@ -1,65 +0,0 @@
-require 'rubygems'
-require 'test/spec'
-require 'activerecord'
-require File.expand_path('../../lib/nested_params', __FILE__)
-
-ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :dbfile => ":memory:")
-ActiveRecord::Migration.verbose = false
-
-def setup_db
- ActiveRecord::Schema.define(:version => 1) do
- create_table :members do |t|
- t.column :email, :string
- end
-
- create_table :visitors do |t|
- t.column :email, :string
- end
-
- create_table :artists do |t|
- t.integer :member_id
- t.integer :visitor_id
- t.string :name
- end
-
- create_table :avatars do |t|
- t.integer :member_id
- t.integer :visitor_id
- t.string :name
- end
- end
-end
-
-def teardown_db
- ActiveRecord::Base.connection.tables.each do |table|
- ActiveRecord::Base.connection.drop_table(table)
- end
-end
-
-class Member < ActiveRecord::Base
- extend NestedParams
- has_one :artist, :nested_params => true
-
- extend AutosaveAssociation
- has_one :avatar, :autosave => true
-end
-
-class Visitor < ActiveRecord::Base
- extend NestedParams
- has_many :artists, :nested_params => true
-
- extend AutosaveAssociation
- has_many :avatars, :autosave => true
-end
-
-class Artist < ActiveRecord::Base
- belongs_to :member
-
- validates_presence_of :name
-end
-
-class Avatar < ActiveRecord::Base
- belongs_to :member
-
- validates_presence_of :name
-end
View
17 vendor/plugins/on_test_spec/.svn/all-wcprops
@@ -1,17 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 49
-/svn/rails-plugins/!svn/ver/47/trunk/on_test_spec
-END
-LICENSE
-K 25
-svn:wc:ra_dav:version-url
-V 57
-/svn/rails-plugins/!svn/ver/26/trunk/on_test_spec/LICENSE
-END
-README
-K 25
-svn:wc:ra_dav:version-url
-V 56
-/svn/rails-plugins/!svn/ver/26/trunk/on_test_spec/README
-END
View
58 vendor/plugins/on_test_spec/.svn/entries
@@ -1,58 +0,0 @@
-8
-
-dir
-47
-https://fngtps.com/svn/rails-plugins/trunk/on_test_spec
-https://fngtps.com/svn/rails-plugins
-
-
-
-2008-08-13T16:40:19.542448Z
-47
-eloy
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-7558d695-cf0b-0410-8a2b-80fd88b37e21
-
-test
-dir
-
-LICENSE
-file
-
-
-
-
-2008-08-19T18:30:27.000000Z
-4ebc94508d67d35851e3180202f8d6b6
-2008-03-13T13:50:46.192852Z
-26
-manfred
-
-lib
-dir
-
-README
-file
-
-
-
-
-2008-08-19T18:30:27.000000Z
-9ef5359c9e84721530dd8eef408ef579
-2008-03-13T13:50:46.192852Z
-26
-manfred
-
View
1  vendor/plugins/on_test_spec/.svn/format
@@ -1 +0,0 @@
-8
View
20 vendor/plugins/on_test_spec/.svn/text-base/LICENSE.svn-base
@@ -1,20 +0,0 @@
-Copyright (c) 2008, Fingertips
-- Manfred Stienstra <manfred@fngtps.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
View
4 vendor/plugins/on_test_spec/.svn/text-base/README.svn-base
@@ -1,4 +0,0 @@
-On Test Spec
-------------
-
-Makes testing Rails apps with test/spec easier and more fun. Created with a half eye on the test_spec_on_rails plugin, thanks!
View
5 vendor/plugins/on_test_spec/lib/.svn/all-wcprops
@@ -1,5 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 53
-/svn/rails-plugins/!svn/ver/47/trunk/on_test_spec/lib
-END
View
31 vendor/plugins/on_test_spec/lib/.svn/entries
@@ -1,31 +0,0 @@
-8
-
-dir
-47
-https://fngtps.com/svn/rails-plugins/trunk/on_test_spec/lib
-https://fngtps.com/svn/rails-plugins
-
-
-
-2008-08-13T16:40:19.542448Z
-47
-eloy
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-7558d695-cf0b-0410-8a2b-80fd88b37e21
-
-test
-dir
-
View
1  vendor/plugins/on_test_spec/lib/.svn/format
@@ -1 +0,0 @@
-8
View
5 vendor/plugins/on_test_spec/lib/test/.svn/all-wcprops
@@ -1,5 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 58
-/svn/rails-plugins/!svn/ver/47/trunk/on_test_spec/lib/test
-END
View
31 vendor/plugins/on_test_spec/lib/test/.svn/entries
@@ -1,31 +0,0 @@
-8
-
-dir
-47
-https://fngtps.com/svn/rails-plugins/trunk/on_test_spec/lib/test
-https://fngtps.com/svn/rails-plugins
-
-
-
-2008-08-13T16:40:19.542448Z
-47
-eloy
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-7558d695-cf0b-0410-8a2b-80fd88b37e21
-
-spec
-dir
-
View
1  vendor/plugins/on_test_spec/lib/test/.svn/format
@@ -1 +0,0 @@
-8
View
17 vendor/plugins/on_test_spec/lib/test/spec/.svn/all-wcprops
@@ -1,17 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 63
-/svn/rails-plugins/!svn/ver/47/trunk/on_test_spec/lib/test/spec
-END
-share.rb
-K 25
-svn:wc:ra_dav:version-url
-V 72
-/svn/rails-plugins/!svn/ver/40/trunk/on_test_spec/lib/test/spec/share.rb
-END
-rails.rb
-K 25
-svn:wc:ra_dav:version-url
-V 72
-/svn/rails-plugins/!svn/ver/28/trunk/on_test_spec/lib/test/spec/rails.rb
-END
View
55 vendor/plugins/on_test_spec/lib/test/spec/.svn/entries
@@ -1,55 +0,0 @@
-8
-
-dir
-47
-https://fngtps.com/svn/rails-plugins/trunk/on_test_spec/lib/test/spec
-https://fngtps.com/svn/rails-plugins
-
-
-
-2008-08-13T16:40:19.542448Z
-47
-eloy
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-7558d695-cf0b-0410-8a2b-80fd88b37e21
-
-share.rb
-file
-
-
-
-
-2008-08-19T18:30:27.000000Z
-671cc43c9d8431fc292b9c1657be6dbe
-2008-05-27T15:04:14.642734Z
-40
-eloy
-
-rails
-dir
-
-rails.rb
-file
-
-
-
-
-2008-08-19T18:30:27.000000Z
-7e836d994b8ba0e7578ca1b1b4843447
-2008-03-13T17:55:58.587282Z
-28
-manfred
-
View
1  vendor/plugins/on_test_spec/lib/test/spec/.svn/format
@@ -1 +0,0 @@
-8
View
19 vendor/plugins/on_test_spec/lib/test/spec/.svn/text-base/rails.rb.svn-base
@@ -1,19 +0,0 @@
-require 'test/spec'
-
-module Test
- module Spec
- class Should
- include ActionController::Assertions
- end
-
- class ShouldNot
- include ActionController::Assertions
- end
-
- module Rails
- end
- end
-end
-
-%w(test_spec_ext spec_responder expectations).each { |lib| require "test/spec/rails/#{lib}" }
-Dir[File.dirname(__FILE__) + '/rails/**/*_helpers.rb'].each { |lib| require lib }
View
48 vendor/plugins/on_test_spec/lib/test/spec/.svn/text-base/share.rb.svn-base
@@ -1,48 +0,0 @@
-$shared_specs = {}
-
-module Kernel
- # Stores the passed in block for inclusion in test cases.
- #
- # share "User" do
- # it "should authenticate" do
- # "me".should == "me"
- # end
- # end
- #
- # describe "User, in general" do
- # shared_specs_for 'User'
- # end
- #
- # describe "User, in another case" do
- # shared_specs_for 'User'
- # end
- #
- # 2 tests, 2 assertions, 0 failures, 0 errors
- def share(name, &specs_block)
- $shared_specs[name] = specs_block
- end
-end
-
-module SharedSpecsInclusionHelper
- # Include the specified shared specs in this test case.
- #
- # share "User" do
- # it "should authenticate" do
- # "me".should == "me"
- # end
- # end
- #
- # describe "User, in general" do
- # shared_specs_for 'User'
- # end
- #
- # describe "User, in another case" do
- # shared_specs_for 'User'
- # end
- #
- # 2 tests, 2 assertions, 0 failures, 0 errors
- def shared_specs_for(name)
- self.class_eval &$shared_specs[name]
- end
-end
-Test::Unit::TestCase.send(:extend, SharedSpecsInclusionHelper)
View
41 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/all-wcprops
@@ -1,41 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 69
-/svn/rails-plugins/!svn/ver/47/trunk/on_test_spec/lib/test/spec/rails
-END
-response_helpers.rb
-K 25
-svn:wc:ra_dav:version-url
-V 89
-/svn/rails-plugins/!svn/ver/28/trunk/on_test_spec/lib/test/spec/rails/response_helpers.rb
-END
-controller_helpers.rb
-K 25
-svn:wc:ra_dav:version-url
-V 91
-/svn/rails-plugins/!svn/ver/28/trunk/on_test_spec/lib/test/spec/rails/controller_helpers.rb
-END
-expectations.rb
-K 25
-svn:wc:ra_dav:version-url
-V 85
-/svn/rails-plugins/!svn/ver/47/trunk/on_test_spec/lib/test/spec/rails/expectations.rb
-END
-test_spec_ext.rb
-K 25
-svn:wc:ra_dav:version-url
-V 86
-/svn/rails-plugins/!svn/ver/28/trunk/on_test_spec/lib/test/spec/rails/test_spec_ext.rb
-END
-request_helpers.rb
-K 25
-svn:wc:ra_dav:version-url
-V 88
-/svn/rails-plugins/!svn/ver/28/trunk/on_test_spec/lib/test/spec/rails/request_helpers.rb
-END
-spec_responder.rb
-K 25
-svn:wc:ra_dav:version-url
-V 87
-/svn/rails-plugins/!svn/ver/28/trunk/on_test_spec/lib/test/spec/rails/spec_responder.rb
-END
View
100 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/entries
@@ -1,100 +0,0 @@
-8
-
-dir
-47
-https://fngtps.com/svn/rails-plugins/trunk/on_test_spec/lib/test/spec/rails
-https://fngtps.com/svn/rails-plugins
-
-
-
-2008-08-13T16:40:19.542448Z
-47
-eloy
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-7558d695-cf0b-0410-8a2b-80fd88b37e21
-
-response_helpers.rb
-file
-
-
-
-
-2008-08-19T18:30:27.000000Z
-8b1c49e8ce3efc04ae62dc17967b9764
-2008-03-13T17:55:58.587282Z
-28
-manfred
-
-controller_helpers.rb
-file
-
-
-
-
-2008-08-19T18:30:27.000000Z
-2d6f3b727b81c4edda29ae007d574d53
-2008-03-13T17:55:58.587282Z
-28
-manfred
-
-expectations.rb
-file
-
-
-
-
-2008-08-19T18:30:27.000000Z
-3f6a00b6985477b2ac72377d3b1c7b9d
-2008-08-13T16:40:19.542448Z
-47
-eloy
-
-test_spec_ext.rb
-file
-
-
-
-
-2008-08-19T18:30:27.000000Z
-1b2c09e1e43675dafd87bd46083fcff8
-2008-03-13T17:55:58.587282Z
-28
-manfred
-
-request_helpers.rb
-file
-
-
-
-
-2008-08-19T18:30:27.000000Z
-62e4c41231746ed93c3f60f859f376d6
-2008-03-13T17:55:58.587282Z
-28
-manfred
-
-spec_responder.rb
-file
-
-
-
-
-2008-08-19T18:30:27.000000Z
-2cf7d47ae9db984e277fa2f1872949dc
-2008-03-13T17:55:58.587282Z
-28
-manfred
-
View
1  vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/format
@@ -1 +0,0 @@
-8
View
32 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/controller_helpers.rb.svn-base
@@ -1,32 +0,0 @@
-module Test
- module Spec
- module Rails
- module Controller
- module ClassMethods
- # Sets up the test environment before every functional test
- def tests(controller_class)
- setups << lambda { setup_request_environment(controller_class) }
- end
- end
- module InstanceMethods
- attr_reader :controller
-
- # Sets up the test environment for functional tests
- def setup_request_environment(controller_class)
- controller_class.class_eval do
- def rescue_action(e)
- raise e
- end
- end
- @controller = controller_class.new
- @controller.request = @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
- end
- end
- end
- end
-end
-
-Test::Spec::TestCase::ClassMethods.send(:include, Test::Spec::Rails::Controller::ClassMethods)
-Test::Unit::TestCase.send(:include, Test::Spec::Rails::Controller::InstanceMethods)
View
86 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/expectations.rb.svn-base
@@ -1,86 +0,0 @@
-module Test
- module Spec
- module Rails
- module ShouldExpectations
- # Test that we were redirected somewhere:
- # should.redirect
- #
- # Test that we were redirected to a specific url:
- # should.redirect :controller => 'foo', :action => 'bar'
- # or:
- # should.redirect_to :controller => 'foo', :action => 'bar', :secure => true
- def redirect(*args)
- if args.empty?
- assert_response @object.response.redirected_to, :redirect
- elsif args.length == 1 and args.first.is_a?(String)
- assert_equal args.first, @object.response.redirected_to
- else
- options = args.extract_options!
- if secure = options.delete(:secure)
- unless secure == true or secure == false
- raise ArgumentError, ":secure option should be a boolean"
- end
- end
-
- @object.instance_eval { assert_redirected_to *args }
- if secure == true
- assert @object.response.redirected_to.starts_with?('https:')
- elsif secure == false
- assert @object.response.redirected_to.starts_with?('http:')
- end
- end
- end
- alias :redirect_to :redirect
-
- # Test that the object is valid
- def validate
- assert_valid @object
- end
-
- # Tests whether the evaluation of the expression changes.
- #
- # lambda { Norm.create }.should.differ('Norm.count')
- # lambda { Norm.create; Norm.create }.should.differ('Norm.count', +2)
- def differ(*args)
- assert_difference(*args, &@object)
- end
- alias change differ
-
- # Tests whether certain pages are cached.
- #
- # lambda { get :index }.should.cache_pages(posts_path)
- # lambda { get :show, :id => post }.should.cache_pages(post_path(post), formatted_posts_path(:js, post))
- def cache_pages(*pages, &block)
- if block
- block.call
- else
- @object.call
- end
- cache_dir = ActionController::Base.page_cache_directory
- files = Dir.glob("#{cache_dir}/**/*").map do |filename|
- filename[cache_dir.length..-1]
- end
- assert pages.all? { |page| files.include?(page) }
- end
- end
- module ShouldNotExpectations
-
- # Test that an object is not valid
- def validate
- assert !@object.valid?
- end
-
- # Tests that the evaluation of the expression shouldn't change
- #
- # lambda { Norm.new }.should.not.differ('Norm.count')
- def differ(*args)
- assert_no_difference(*args, &@object)
- end
- alias change differ
- end
- end
- end
-end
-
-Test::Spec::Should.send(:include, Test::Spec::Rails::ShouldExpectations)
-Test::Spec::ShouldNot.send(:include, Test::Spec::Rails::ShouldNotExpectations)
View
11 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/request_helpers.rb.svn-base
@@ -1,11 +0,0 @@
-module Test
- module Spec
- module Rails
- module RequestHelpers
- attr_reader :request
- end
- end
- end
-end
-
-Test::Unit::TestCase.send(:include, Test::Spec::Rails::RequestHelpers)
View
42 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/response_helpers.rb.svn-base
@@ -1,42 +0,0 @@
-module Test
- module Spec
- module Rails
- class Status < SpecResponder
- def should_equal(status, message=nil)
- @test_case.send(:assert_response, status, message)
- end
- end
-
- class Template < SpecResponder
- def should_equal(template, message=nil)
- @test_case.send(:assert_template, template, message)
- end
- end
-
- class Layout < SpecResponder
- def should_equal(layout, message=nil)
- rendered_layout = @test_case.response.layout.gsub(/layouts\//, '')
- @test_case.send(:assert_equal, layout, rendered_layout, message)
- end
- end
-
- module ResponseHelpers
- attr_reader :response
-
- def status
- Test::Spec::Rails::Status.new(self)
- end
-
- def template
- Test::Spec::Rails::Template.new(self)
- end
-
- def layout
- Test::Spec::Rails::Layout.new(self)
- end
- end
- end
- end
-end
-
-Test::Unit::TestCase.send(:include, Test::Spec::Rails::ResponseHelpers)
View
12 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/spec_responder.rb.svn-base
@@ -1,12 +0,0 @@
-module Test
- module Spec
- module Rails
- class SpecResponder
- attr_accessor :test_case
- def initialize(test_case)
- self.test_case = test_case
- end
- end
- end
- end
-end
View
23 vendor/plugins/on_test_spec/lib/test/spec/rails/.svn/text-base/test_spec_ext.rb.svn-base
@@ -1,23 +0,0 @@
-class Test::Spec::Should
- alias :_test_spec_equal :equal
- def equal(*args)
- @object.respond_to?(:should_equal) ? @object.should_equal(*args) : _test_spec_equal(*args)
- end
-
- alias :_test_spec_be :be
- def be(*args)
- @object.respond_to?(:should_equal) ? @object.should_equal(*args) : _test_spec_be(*args)
- end
-end
-
-class Test::Spec::ShouldNot
- alias :_test_spec_equal :equal
- def equal(*args)
- @object.respond_to?(:should_not_equal) ? @object.should_not_equal(*args) : _test_spec_equal(*args)
- end
-
- alias :_test_spec_be :be
- def be(*args)
- @object.respond_to?(:should_not_equal) ? @object.should_not_equal(*args) : _test_spec_be(*args)
- end
-end
View
11 vendor/plugins/on_test_spec/test/.svn/all-wcprops
@@ -1,11 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 54
-/svn/rails-plugins/!svn/ver/40/trunk/on_test_spec/test
-END
-share_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 68
-/svn/rails-plugins/!svn/ver/40/trunk/on_test_spec/test/share_test.rb
-END
View
40 vendor/plugins/on_test_spec/test/.svn/entries
@@ -1,40 +0,0 @@
-8
-
-dir
-47
-https://fngtps.com/svn/rails-plugins/trunk/on_test_spec/test
-https://fngtps.com/svn/rails-plugins
-
-
-
-2008-05-27T15:04:14.642734Z
-40
-eloy
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-7558d695-cf0b-0410-8a2b-80fd88b37e21
-
-share_test.rb
-file
-
-
-
-
-2008-08-19T18:30:27.000000Z
-0f06f7e86ad65f4de0423de5a4eab043
-2008-05-27T15:04:14.642734Z
-40
-eloy
-
View
1  vendor/plugins/on_test_spec/test/.svn/format
@@ -1 +0,0 @@
-8
View
52 vendor/plugins/on_test_spec/test/.svn/text-base/share_test.rb.svn-base
@@ -1,52 +0,0 @@
-require 'rubygems' rescue LoadError
-require 'test/spec'
-
-require File.expand_path('../../lib/test/spec/share', __FILE__)
-
-class DummyMock
- extend SharedSpecsInclusionHelper
-
- class << self
- attr_reader :times_called
- def it(name, &block)
- @times_called ||= 0
- @times_called += 1
- end
- end
-end
-
-share "Dummy" do
- it("spec 1") {}
- it("spec 2") {}
-end
-
-describe "Shared specs" do
- it "should define a global variable that will hold all the shared specs" do
- $shared_specs.should.be.instance_of Hash
- end
-end
-
-describe "Kernel#share" do
- it "should add the shared specs to the global shared modules variable" do
- before = $shared_specs.length
- share("Bar") {}
- $shared_specs.length.should == before + 1
- end
-
- it "should have stored the proc that holds the specs" do
- $shared_specs['Dummy'].should.be.instance_of Proc
- end
-end
-
-describe "SharedSpecsInclusionHelper::shared_specs_for" do
- it "should have extended Test::Unit::TestCase" do
- Test::Unit::TestCase.should.respond_to :shared_specs_for
- end
-
- it "should return the specified module containing the shared specs" do
- DummyMock.class_eval do
- shared_specs_for 'Dummy'
- end
- DummyMock.times_called.should.be 2
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.