dm-validations 0.10.2 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. data/.gitignore +36 -0
  2. data/Gemfile +143 -0
  3. data/README.rdoc +52 -102
  4. data/Rakefile +3 -3
  5. data/VERSION +1 -1
  6. data/dm-validations.gemspec +126 -14
  7. data/lib/dm-validations.rb +78 -18
  8. data/lib/dm-validations/auto_validate.rb +27 -23
  9. data/lib/dm-validations/contextual_validators.rb +3 -3
  10. data/lib/dm-validations/formats/email.rb +3 -3
  11. data/lib/dm-validations/formats/url.rb +3 -3
  12. data/lib/dm-validations/support/context.rb +1 -1
  13. data/lib/dm-validations/validation_errors.rb +5 -7
  14. data/lib/dm-validations/validators/absent_field_validator.rb +13 -9
  15. data/lib/dm-validations/validators/acceptance_validator.rb +10 -7
  16. data/lib/dm-validations/validators/block_validator.rb +3 -3
  17. data/lib/dm-validations/validators/confirmation_validator.rb +10 -7
  18. data/lib/dm-validations/validators/format_validator.rb +14 -10
  19. data/lib/dm-validations/validators/generic_validator.rb +3 -3
  20. data/lib/dm-validations/validators/length_validator.rb +10 -7
  21. data/lib/dm-validations/validators/method_validator.rb +3 -3
  22. data/lib/dm-validations/validators/numeric_validator.rb +25 -14
  23. data/lib/dm-validations/validators/primitive_validator.rb +12 -8
  24. data/lib/dm-validations/validators/required_field_validator.rb +12 -9
  25. data/lib/dm-validations/validators/uniqueness_validator.rb +9 -6
  26. data/lib/dm-validations/validators/within_validator.rb +3 -3
  27. data/spec/fixtures/barcode.rb +10 -2
  28. data/spec/fixtures/basketball_court.rb +7 -7
  29. data/spec/fixtures/basketball_player.rb +3 -3
  30. data/spec/fixtures/beta_tester_account.rb +4 -4
  31. data/spec/fixtures/bill_of_landing.rb +7 -7
  32. data/spec/fixtures/boat_dock.rb +2 -2
  33. data/spec/fixtures/city.rb +1 -1
  34. data/spec/fixtures/company.rb +7 -7
  35. data/spec/fixtures/corporate_world.rb +24 -26
  36. data/spec/fixtures/country.rb +1 -1
  37. data/spec/fixtures/currency.rb +4 -4
  38. data/spec/fixtures/ethernet_frame.rb +5 -5
  39. data/spec/fixtures/event.rb +2 -2
  40. data/spec/fixtures/g3_concert.rb +3 -3
  41. data/spec/fixtures/jabberwock.rb +2 -2
  42. data/spec/fixtures/kayak.rb +2 -2
  43. data/spec/fixtures/lernean_hydra.rb +3 -3
  44. data/spec/fixtures/mathematical_function.rb +2 -2
  45. data/spec/fixtures/memory_object.rb +3 -3
  46. data/spec/fixtures/mittelschnauzer.rb +3 -3
  47. data/spec/fixtures/motor_launch.rb +1 -1
  48. data/spec/fixtures/page.rb +3 -3
  49. data/spec/fixtures/phone_number.rb +2 -2
  50. data/spec/fixtures/pirogue.rb +2 -2
  51. data/spec/fixtures/programming_language.rb +3 -3
  52. data/spec/fixtures/reservation.rb +5 -5
  53. data/spec/fixtures/scm_operation.rb +42 -45
  54. data/spec/fixtures/sms_message.rb +1 -1
  55. data/spec/fixtures/udp_packet.rb +3 -3
  56. data/spec/integration/absent_field_validator/absent_field_validator_spec.rb +6 -6
  57. data/spec/integration/acceptance_validator/acceptance_validator_spec.rb +3 -3
  58. data/spec/integration/automatic_validation/inferred_length_validation_spec.rb +5 -5
  59. data/spec/integration/automatic_validation/spec_helper.rb +1 -1
  60. data/spec/integration/block_validator/block_validator_spec.rb +2 -2
  61. data/spec/integration/conditional_validation/if_condition_spec.rb +3 -3
  62. data/spec/integration/confirmation_validator/confirmation_validator_spec.rb +3 -3
  63. data/spec/integration/datamapper_models/association_validation_spec.rb +5 -5
  64. data/spec/integration/datamapper_models/inheritance_spec.rb +6 -6
  65. data/spec/integration/duplicated_validations/duplicated_validations_spec.rb +3 -3
  66. data/spec/integration/format_validator/email_format_validator_spec.rb +6 -6
  67. data/spec/integration/format_validator/format_validator_spec.rb +8 -8
  68. data/spec/integration/format_validator/regexp_validator_spec.rb +4 -4
  69. data/spec/integration/format_validator/url_format_validator_spec.rb +4 -4
  70. data/spec/integration/length_validator/default_value_spec.rb +3 -3
  71. data/spec/integration/length_validator/equality_spec.rb +4 -4
  72. data/spec/integration/length_validator/error_message_spec.rb +3 -3
  73. data/spec/integration/length_validator/maximum_spec.rb +3 -3
  74. data/spec/integration/length_validator/minimum_spec.rb +3 -3
  75. data/spec/integration/length_validator/range_spec.rb +3 -3
  76. data/spec/integration/method_validator/method_validator_spec.rb +8 -8
  77. data/spec/integration/numeric_validator/equality_with_float_type_spec.rb +7 -7
  78. data/spec/integration/numeric_validator/equality_with_integer_type_spec.rb +5 -5
  79. data/spec/integration/numeric_validator/float_type_spec.rb +3 -3
  80. data/spec/integration/numeric_validator/gt_with_float_type_spec.rb +3 -3
  81. data/spec/integration/numeric_validator/gte_with_float_type_spec.rb +3 -3
  82. data/spec/integration/numeric_validator/lt_with_float_type_spec.rb +3 -3
  83. data/spec/integration/numeric_validator/lte_with_float_type_spec.rb +3 -3
  84. data/spec/integration/primitive_validator/primitive_validator_spec.rb +4 -4
  85. data/spec/integration/pure_ruby_objects/plain_old_ruby_object_validation_spec.rb +4 -4
  86. data/spec/integration/required_field_validator/association_spec.rb +19 -51
  87. data/spec/integration/required_field_validator/boolean_type_value_spec.rb +4 -1
  88. data/spec/integration/required_field_validator/date_type_value_spec.rb +4 -2
  89. data/spec/integration/required_field_validator/datetime_type_value_spec.rb +4 -2
  90. data/spec/integration/required_field_validator/float_type_value_spec.rb +4 -2
  91. data/spec/integration/required_field_validator/integer_type_value_spec.rb +4 -2
  92. data/spec/integration/required_field_validator/plain_old_ruby_object_spec.rb +6 -4
  93. data/spec/integration/required_field_validator/string_type_value_spec.rb +3 -1
  94. data/spec/integration/required_field_validator/text_type_value_spec.rb +3 -1
  95. data/spec/integration/shared/valid_and_invalid_model.rb +8 -0
  96. data/spec/integration/uniqueness_validator/uniqueness_validator_spec.rb +29 -25
  97. data/spec/integration/within_validator/within_validator_spec.rb +6 -6
  98. data/spec/public/resource_spec.rb +47 -9
  99. data/spec/spec_helper.rb +13 -27
  100. data/spec/unit/contextual_validators/emptiness_spec.rb +4 -4
  101. data/spec/unit/contextual_validators/execution_spec.rb +6 -6
  102. data/spec/unit/contextual_validators/spec_helper.rb +3 -3
  103. data/spec/unit/generic_validator/equality_operator_spec.rb +7 -7
  104. data/spec/unit/validation_errors/adding_spec.rb +2 -2
  105. data/spec/unit/validation_errors/emptiness_spec.rb +2 -2
  106. data/spec/unit/validation_errors/enumerable_spec.rb +2 -2
  107. data/tasks/local_gemfile.rake +18 -0
  108. data/tasks/spec.rake +0 -3
  109. metadata +157 -25
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module DataMapper
4
- module Validate
4
+ module Validations
5
5
  module Fixtures
6
6
  class MathematicalFunction
7
7
  #
@@ -30,5 +30,5 @@ module DataMapper
30
30
  validates_within :output, :set => (-n..0), :message => "Negative values or zero only, please"
31
31
  end # MathematicalFunction
32
32
  end # Fixtures
33
- end # Validate
33
+ end # Validations
34
34
  end # DataMapper
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module DataMapper
4
- module Validate
4
+ module Validations
5
5
  module Fixtures
6
6
  class MemoryObject
7
7
  #
@@ -22,8 +22,8 @@ module DataMapper
22
22
  # Validations
23
23
  #
24
24
 
25
- validates_is_primitive :marked
26
- validates_is_primitive :color
25
+ validates_primitive_type_of :marked
26
+ validates_primitive_type_of :color
27
27
  end
28
28
  end
29
29
  end
@@ -1,5 +1,5 @@
1
1
  module DataMapper
2
- module Validate
2
+ module Validations
3
3
  module Fixtures
4
4
  class Mittelschnauzer
5
5
 
@@ -22,9 +22,9 @@ module DataMapper
22
22
  # Validations
23
23
  #
24
24
 
25
- validates_length :name, :min => 2, :allow_nil => false
25
+ validates_length_of :name, :min => 2, :allow_nil => false
26
26
 
27
- validates_is_number :height, :lt => 55.2
27
+ validates_numericality_of :height, :lt => 55.2
28
28
 
29
29
  def self.valid_instance
30
30
  new(:name => "Roudolf Wilde", :height => 50.4)
@@ -1,5 +1,5 @@
1
1
  module DataMapper
2
- module Validate
2
+ module Validations
3
3
  module Fixtures
4
4
 
5
5
  class MotorLaunch
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module DataMapper
4
- module Validate
4
+ module Validations
5
5
  module Fixtures
6
6
 
7
7
  # see http://datamapper.lighthouseapp.com/projects/20609/tickets/671
@@ -25,8 +25,8 @@ module DataMapper
25
25
 
26
26
  # duplicates inferred validation for body (caused by
27
27
  # :required => true)
28
- validates_present :body
28
+ validates_presence_of :body
29
29
  end
30
30
  end # Fixtures
31
- end # Validate
31
+ end # Validations
32
32
  end # DataMapper
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module DataMapper
4
- module Validate
4
+ module Validations
5
5
  module Fixtures
6
6
  class PhoneNumber
7
7
  #
@@ -24,5 +24,5 @@ module DataMapper
24
24
  validates_within :type_of_number, :set => %w(home work cell), :message => "Should be one of: home, cell or work"
25
25
  end # PhoneNumber
26
26
  end # Fixtures
27
- end # Validate
27
+ end # Validations
28
28
  end # DataMapper
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module DataMapper
4
- module Validate
4
+ module Validations
5
5
  module Fixtures
6
6
  class Pirogue
7
7
  #
@@ -21,7 +21,7 @@ module DataMapper
21
21
  # Validations
22
22
  #
23
23
 
24
- validates_absent :salesman, :on => :sale
24
+ validates_absence_of :salesman, :on => :sale
25
25
  end
26
26
  end
27
27
  end
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module DataMapper
4
- module Validate
4
+ module Validations
5
5
  module Fixtures
6
6
  # If you think that this particular fixture class
7
7
  # and assumptions made below are full of bullshit
@@ -15,7 +15,7 @@ module DataMapper
15
15
  # Behaviors
16
16
  #
17
17
 
18
- include ::DataMapper::Validate
18
+ include ::DataMapper::Validations
19
19
 
20
20
  #
21
21
  # Attributes
@@ -79,5 +79,5 @@ module DataMapper
79
79
  end
80
80
  end # ProgrammingLanguage
81
81
  end # Fixtures
82
- end # Validate
82
+ end # Validations
83
83
  end # DataMapper
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module DataMapper
4
- module Validate
4
+ module Validations
5
5
  module Fixtures
6
6
  class Reservation
7
7
  #
@@ -28,11 +28,11 @@ module DataMapper
28
28
  # Validations
29
29
  #
30
30
 
31
- validates_is_confirmed :person_name, :allow_nil => false, :allow_blank => false
32
- validates_is_confirmed :number_of_seats, :confirm => :seats_confirmation, :message => Proc.new { |resource, property|
33
- '%s requires confirmation for %s' % [Extlib::Inflection.demodulize(resource.model.name), property.name]
31
+ validates_confirmation_of :person_name, :allow_nil => false, :allow_blank => false
32
+ validates_confirmation_of :number_of_seats, :confirm => :seats_confirmation, :message => Proc.new { |resource, property|
33
+ '%s requires confirmation for %s' % [ActiveSupport::Inflector.demodulize(resource.model.name), property.name]
34
34
  }
35
35
  end # Reservation
36
36
  end # Fixtures
37
- end # Validate
37
+ end # Validations
38
38
  end # DataMapper
@@ -1,59 +1,56 @@
1
- if HAS_SQLITE3 || HAS_MYSQL || HAS_POSTGRES
1
+ #
2
+ # SCMs
3
+ #
4
+ # This example may look stupid (I am sure it is),
5
+ # but it is way better than foobars and easier to read/add cases
6
+ # compared to gardening examples because every software engineer has idea
7
+ # about SCMs and not every software engineer does gardening often.
8
+ #
9
+
10
+ class ScmOperation
11
+ include DataMapper::Resource
2
12
 
3
13
  #
4
- # SCMs
14
+ # Property
5
15
  #
6
- # This example may look stupid (I am sure it is),
7
- # but it is way better than foobars and easier to read/add cases
8
- # compared to gardening examples because every software engineer has idea
9
- # about SCMs and not every software engineer does gardening often.
10
- #
11
-
12
- class ScmOperation
13
- include DataMapper::Resource
14
-
15
- #
16
- # Property
17
- #
18
16
 
19
- property :id, Serial
17
+ property :id, Serial
20
18
 
21
- # operation name
22
- property :name, String, :auto_validation => false
19
+ # operation name
20
+ property :name, String, :auto_validation => false
23
21
 
24
- property :committer_name, String, :auto_validation => false, :default => "Just another Ruby hacker"
25
- property :author_name, String, :auto_validation => false, :default => "Just another Ruby hacker"
26
- property :network_connection, Boolean, :auto_validation => false
27
- property :message, Text, :auto_validation => false
28
- property :clean_working_copy, Boolean, :auto_validation => false
22
+ property :committer_name, String, :auto_validation => false, :default => "Just another Ruby hacker"
23
+ property :author_name, String, :auto_validation => false, :default => "Just another Ruby hacker"
24
+ property :network_connection, Boolean, :auto_validation => false
25
+ property :message, Text, :auto_validation => false
26
+ property :clean_working_copy, Boolean, :auto_validation => false
29
27
 
30
- #
31
- # Validations
32
- #
28
+ #
29
+ # Validations
30
+ #
33
31
 
34
- validates_present :name
35
- end
32
+ validates_presence_of :name
33
+ end
36
34
 
37
- class SubversionOperation < ScmOperation
38
- #
39
- # Validations
40
- #
35
+ class SubversionOperation < ScmOperation
36
+ #
37
+ # Validations
38
+ #
41
39
 
42
- validates_present :network_connection, :when => [:committing, :log_viewing]
43
- end
40
+ validates_presence_of :network_connection, :when => [:committing, :log_viewing]
41
+ end
44
42
 
45
- class GitOperation < ScmOperation
46
- #
47
- # Validations
48
- #
43
+ class GitOperation < ScmOperation
44
+ #
45
+ # Validations
46
+ #
49
47
 
50
- validates_present :author_name, :committer_name, :when => :committing
48
+ validates_presence_of :author_name, :committer_name, :when => :committing
51
49
 
52
- validates_present :message, :when => :committing
53
- validates_present :network_connection, :when => [:pushing, :pulling], :message => {
54
- :pushing => "though git is advanced, it cannot push without network connectivity",
55
- :pulling => "you must have network connectivity to pull from others"
56
- }
57
- validates_present :clean_working_copy, :when => :pulling
58
- end
50
+ validates_presence_of :message, :when => :committing
51
+ validates_presence_of :network_connection, :when => [:pushing, :pulling], :message => {
52
+ :pushing => "though git is advanced, it cannot push without network connectivity",
53
+ :pulling => "you must have network connectivity to pull from others"
54
+ }
55
+ validates_presence_of :clean_working_copy, :when => :pulling
59
56
  end
@@ -1,5 +1,5 @@
1
1
  module DataMapper
2
- module Validate
2
+ module Validations
3
3
  module Fixtures
4
4
 
5
5
  class SmsMessage
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module DataMapper
4
- module Validate
4
+ module Validations
5
5
  module Fixtures
6
6
 
7
7
  class UDPPacket
@@ -41,9 +41,9 @@ module DataMapper
41
41
  # Validations
42
42
  #
43
43
 
44
- validates_present :checksum_algorithm, :checksum, :if => Proc.new { |packet| packet.underlying_ip_version == 6 }, :message => "Checksum is mandatory when used with IPv6"
44
+ validates_presence_of :checksum_algorithm, :checksum, :if => Proc.new { |packet| packet.underlying_ip_version == 6 }, :message => "Checksum is mandatory when used with IPv6"
45
45
  end
46
46
 
47
47
  end # Fixtures
48
- end # Validate
48
+ end # Validations
49
49
  end # DataMapper
@@ -1,11 +1,11 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/absent_field_validator/spec_helper'
3
3
 
4
- describe 'DataMapper::Validate::Fixtures::Kayak' do
4
+ describe 'DataMapper::Validations::Fixtures::Kayak' do
5
5
  before :all do
6
- DataMapper::Validate::Fixtures::Kayak.auto_migrate!
6
+ DataMapper::Validations::Fixtures::Kayak.auto_migrate!
7
7
 
8
- @kayak = DataMapper::Validate::Fixtures::Kayak.new
8
+ @kayak = DataMapper::Validations::Fixtures::Kayak.new
9
9
  @kayak.should be_valid_for_sale
10
10
  end
11
11
 
@@ -70,11 +70,11 @@ describe 'DataMapper::Validate::Fixtures::Kayak' do
70
70
  end
71
71
 
72
72
 
73
- describe 'DataMapper::Validate::Fixtures::Pirogue' do
73
+ describe 'DataMapper::Validations::Fixtures::Pirogue' do
74
74
  before :all do
75
- DataMapper::Validate::Fixtures::Pirogue.auto_migrate!
75
+ DataMapper::Validations::Fixtures::Pirogue.auto_migrate!
76
76
 
77
- @kayak = DataMapper::Validate::Fixtures::Pirogue.new
77
+ @kayak = DataMapper::Validations::Fixtures::Pirogue.new
78
78
  @kayak.should_not be_valid_for_sale
79
79
  end
80
80
 
@@ -1,13 +1,13 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/acceptance_validator/spec_helper'
3
3
 
4
- describe 'DataMapper::Validate::Fixtures::BetaTesterAccount' do
4
+ describe 'DataMapper::Validations::Fixtures::BetaTesterAccount' do
5
5
  before :all do
6
- DataMapper::Validate::Fixtures::BetaTesterAccount.auto_migrate!
6
+ DataMapper::Validations::Fixtures::BetaTesterAccount.auto_migrate!
7
7
  end
8
8
 
9
9
  before do
10
- @model = DataMapper::Validate::Fixtures::BetaTesterAccount.new(:user_agreement => true,
10
+ @model = DataMapper::Validations::Fixtures::BetaTesterAccount.new(:user_agreement => true,
11
11
  :newsletter_signup => nil,
12
12
  :privacy_agreement => "accept")
13
13
  @model.should be_valid
@@ -26,7 +26,7 @@ describe 'SailBoat' do
26
26
  @model.description = 'ABCDEFGHIJK' #11
27
27
  end
28
28
 
29
- # validates_length is inferred from property's :length option
29
+ # validates_length_of is inferred from property's :length option
30
30
  it "is invalid" do
31
31
  @model.should_not be_valid_for_length_test_1
32
32
  @model.errors.on(:description).should == [ 'Description must be at most 10 characters long' ]
@@ -39,7 +39,7 @@ describe 'SailBoat' do
39
39
  @model.description = 'ABCDEFGHI' # 9
40
40
  end
41
41
 
42
- # validates_length is inferred from property's :length option
42
+ # validates_length_of is inferred from property's :length option
43
43
  it_should_behave_like "valid model"
44
44
  end
45
45
 
@@ -80,11 +80,11 @@ end
80
80
 
81
81
 
82
82
 
83
- describe 'DataMapper::Validate::Fixtures::SmsMessage' do
83
+ describe 'DataMapper::Validations::Fixtures::SmsMessage' do
84
84
  before :all do
85
- DataMapper::Validate::Fixtures::SmsMessage.auto_migrate!
85
+ DataMapper::Validations::Fixtures::SmsMessage.auto_migrate!
86
86
 
87
- @model = DataMapper::Validate::Fixtures::SmsMessage.new(:id => 10)
87
+ @model = DataMapper::Validations::Fixtures::SmsMessage.new(:id => 10)
88
88
  end
89
89
 
90
90
  describe "with 2 character long note" do
@@ -35,7 +35,7 @@ class SailBoat
35
35
  property :allow_nil, String, :length => 5..10, :required => false, :validates => :nil_test
36
36
  property :build_date, Date, :validates => :primitive_test
37
37
  property :float, Float, :precision => 2, :scale => 1
38
- property :big_decimal, BigDecimal, :precision => 2, :scale => 1
38
+ property :big_decimal, Decimal, :precision => 2, :scale => 1
39
39
 
40
40
  include TypecastBypassSetter
41
41
  end
@@ -1,9 +1,9 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/block_validator/spec_helper'
3
3
 
4
- describe 'DataMapper::Validate::Fixtures::G3Concert' do
4
+ describe 'DataMapper::Validations::Fixtures::G3Concert' do
5
5
  before :all do
6
- @model = DataMapper::Validate::Fixtures::G3Concert.new(:year => 2004, :participants => "Joe Satriani, Steve Vai, Yngwie Malmsteen", :city => "Denver")
6
+ @model = DataMapper::Validations::Fixtures::G3Concert.new(:year => 2004, :participants => "Joe Satriani, Steve Vai, Yngwie Malmsteen", :city => "Denver")
7
7
  @model.should be_valid
8
8
  end
9
9
 
@@ -1,11 +1,11 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/conditional_validation/spec_helper'
3
3
 
4
- describe 'DataMapper::Validate::Fixtures::UDPPacket' do
4
+ describe 'DataMapper::Validations::Fixtures::UDPPacket' do
5
5
  before :all do
6
- DataMapper::Validate::Fixtures::UDPPacket.auto_migrate!
6
+ DataMapper::Validations::Fixtures::UDPPacket.auto_migrate!
7
7
 
8
- @model = DataMapper::Validate::Fixtures::UDPPacket.new
8
+ @model = DataMapper::Validations::Fixtures::UDPPacket.new
9
9
  end
10
10
 
11
11
  describe "that is transported encapsulated into IPv4 packet" do
@@ -15,11 +15,11 @@ describe "reservation with mismatched seats number", :shared => true do
15
15
  end
16
16
 
17
17
 
18
- describe 'DataMapper::Validate::Fixtures::Reservation' do
18
+ describe 'DataMapper::Validations::Fixtures::Reservation' do
19
19
  before :all do
20
- DataMapper::Validate::Fixtures::Reservation.auto_migrate!
20
+ DataMapper::Validations::Fixtures::Reservation.auto_migrate!
21
21
 
22
- @model = DataMapper::Validate::Fixtures::Reservation.new(:person_name => "Tyler Durden",
22
+ @model = DataMapper::Validations::Fixtures::Reservation.new(:person_name => "Tyler Durden",
23
23
  :person_name_confirmation => "Tyler Durden",
24
24
  :number_of_seats => 2,
25
25
  :seats_confirmation => 2)
@@ -1,14 +1,14 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'DataMapper::Validate::Fixtures::Product' do
3
+ describe 'DataMapper::Validations::Fixtures::Product' do
4
4
  before :all do
5
- DataMapper::Validate::Fixtures::ProductCompany.auto_migrate!
6
- DataMapper::Validate::Fixtures::Product.auto_migrate!
5
+ DataMapper::Validations::Fixtures::ProductCompany.auto_migrate!
6
+ DataMapper::Validations::Fixtures::Product.auto_migrate!
7
7
 
8
- @parent = DataMapper::Validate::Fixtures::ProductCompany.create(:title => "Apple", :flagship_product => "Macintosh")
8
+ @parent = DataMapper::Validations::Fixtures::ProductCompany.create(:title => "Apple", :flagship_product => "Macintosh")
9
9
  @parent.should be_valid
10
10
 
11
- @model = DataMapper::Validate::Fixtures::Product.new(:name => "MacBook Pro", :company => @parent)
11
+ @model = DataMapper::Validations::Fixtures::Product.new(:name => "MacBook Pro", :company => @parent)
12
12
  @model.should be_valid
13
13
  end
14
14