dm-validations 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/Rakefile +23 -18
  2. data/VERSION +1 -0
  3. data/dm-validations.gemspec +188 -0
  4. data/lib/dm-validations.rb +25 -75
  5. data/lib/dm-validations/auto_validate.rb +7 -7
  6. data/lib/dm-validations/contextual_validators.rb +4 -18
  7. data/lib/dm-validations/exceptions.rb +3 -1
  8. data/lib/dm-validations/support/context.rb +40 -1
  9. data/lib/dm-validations/validation_errors.rb +2 -13
  10. data/lib/dm-validations/validators/absent_field_validator.rb +2 -2
  11. data/lib/dm-validations/validators/acceptance_validator.rb +14 -16
  12. data/lib/dm-validations/validators/confirmation_validator.rb +17 -15
  13. data/lib/dm-validations/validators/format_validator.rb +18 -11
  14. data/lib/dm-validations/validators/generic_validator.rb +45 -15
  15. data/lib/dm-validations/validators/length_validator.rb +2 -11
  16. data/lib/dm-validations/validators/method_validator.rb +2 -2
  17. data/lib/dm-validations/validators/numeric_validator.rb +8 -6
  18. data/lib/dm-validations/validators/primitive_validator.rb +1 -1
  19. data/lib/dm-validations/validators/uniqueness_validator.rb +13 -9
  20. data/lib/dm-validations/validators/within_validator.rb +4 -3
  21. data/spec/fixtures/basketball_player.rb +0 -3
  22. data/spec/fixtures/bill_of_landing.rb +1 -1
  23. data/spec/fixtures/city.rb +0 -1
  24. data/spec/fixtures/company.rb +1 -3
  25. data/spec/fixtures/corporate_world.rb +0 -6
  26. data/spec/fixtures/country.rb +0 -1
  27. data/spec/fixtures/event.rb +1 -1
  28. data/spec/fixtures/page.rb +2 -2
  29. data/spec/fixtures/reservation.rb +1 -1
  30. data/spec/fixtures/scm_operation.rb +0 -8
  31. data/spec/integration/absent_field_validator/absent_field_validator_spec.rb +6 -2
  32. data/spec/integration/acceptance_validator/acceptance_validator_spec.rb +36 -36
  33. data/spec/integration/automatic_validation/custom_messages_for_inferred_validation_spec.rb +2 -2
  34. data/spec/integration/automatic_validation/disabling_inferred_validation_spec.rb +4 -4
  35. data/spec/integration/automatic_validation/inferred_boolean_properties_validation_spec.rb +2 -2
  36. data/spec/integration/automatic_validation/inferred_float_property_validation_spec.rb +2 -0
  37. data/spec/integration/automatic_validation/inferred_format_validation_spec.rb +3 -1
  38. data/spec/integration/automatic_validation/inferred_integer_properties_validation_spec.rb +2 -0
  39. data/spec/integration/automatic_validation/inferred_length_validation_spec.rb +6 -2
  40. data/spec/integration/automatic_validation/inferred_presence_validation_spec.rb +8 -4
  41. data/spec/integration/automatic_validation/inferred_primitive_validation_spec.rb +3 -1
  42. data/spec/integration/automatic_validation/spec_helper.rb +6 -6
  43. data/spec/integration/block_validator/block_validator_spec.rb +1 -1
  44. data/spec/integration/conditional_validation/if_condition_spec.rb +3 -1
  45. data/spec/integration/confirmation_validator/confirmation_validator_spec.rb +3 -1
  46. data/spec/integration/datamapper_models/association_validation_spec.rb +4 -1
  47. data/spec/integration/datamapper_models/inheritance_spec.rb +6 -2
  48. data/spec/integration/duplicated_validations/duplicated_validations_spec.rb +3 -1
  49. data/spec/integration/format_validator/email_format_validator_spec.rb +5 -1
  50. data/spec/integration/format_validator/format_validator_spec.rb +5 -1
  51. data/spec/integration/format_validator/regexp_validator_spec.rb +5 -1
  52. data/spec/integration/format_validator/url_format_validator_spec.rb +8 -4
  53. data/spec/integration/length_validator/default_value_spec.rb +4 -2
  54. data/spec/integration/length_validator/equality_spec.rb +3 -1
  55. data/spec/integration/length_validator/error_message_spec.rb +3 -1
  56. data/spec/integration/length_validator/maximum_spec.rb +3 -1
  57. data/spec/integration/length_validator/minimum_spec.rb +3 -1
  58. data/spec/integration/length_validator/range_spec.rb +3 -1
  59. data/spec/integration/method_validator/method_validator_spec.rb +3 -1
  60. data/spec/integration/numeric_validator/equality_with_float_type_spec.rb +5 -1
  61. data/spec/integration/numeric_validator/equality_with_integer_type_spec.rb +5 -1
  62. data/spec/integration/numeric_validator/float_type_spec.rb +3 -1
  63. data/spec/integration/numeric_validator/gt_with_float_type_spec.rb +3 -1
  64. data/spec/integration/numeric_validator/gte_with_float_type_spec.rb +3 -1
  65. data/spec/integration/numeric_validator/integer_only_true_spec.rb +11 -9
  66. data/spec/integration/numeric_validator/integer_type_spec.rb +10 -8
  67. data/spec/integration/numeric_validator/lt_with_float_type_spec.rb +3 -1
  68. data/spec/integration/numeric_validator/lte_with_float_type_spec.rb +3 -1
  69. data/spec/integration/primitive_validator/primitive_validator_spec.rb +3 -1
  70. data/spec/integration/pure_ruby_objects/plain_old_ruby_object_validation_spec.rb +6 -6
  71. data/spec/integration/required_field_validator/association_spec.rb +9 -4
  72. data/spec/integration/required_field_validator/boolean_type_value_spec.rb +24 -18
  73. data/spec/integration/required_field_validator/date_type_value_spec.rb +21 -19
  74. data/spec/integration/required_field_validator/datetime_type_value_spec.rb +21 -19
  75. data/spec/integration/required_field_validator/float_type_value_spec.rb +21 -19
  76. data/spec/integration/required_field_validator/integer_type_value_spec.rb +17 -15
  77. data/spec/integration/required_field_validator/shared_examples.rb +5 -3
  78. data/spec/integration/required_field_validator/string_type_value_spec.rb +20 -16
  79. data/spec/integration/required_field_validator/text_type_value_spec.rb +10 -6
  80. data/spec/integration/uniqueness_validator/uniqueness_validator_spec.rb +23 -25
  81. data/spec/integration/within_validator/within_validator_spec.rb +7 -3
  82. data/spec/public/resource_spec.rb +5 -6
  83. data/spec/rcov.opts +6 -0
  84. data/spec/spec.opts +2 -0
  85. data/spec/unit/contextual_validators/emptiness_spec.rb +1 -1
  86. data/spec/unit/contextual_validators/execution_spec.rb +9 -16
  87. data/spec/unit/generic_validator/equality_operator_spec.rb +3 -3
  88. data/spec/unit/validation_errors/adding_spec.rb +1 -1
  89. data/spec/unit/validation_errors/emptiness_spec.rb +1 -1
  90. data/spec/unit/validation_errors/enumerable_spec.rb +1 -1
  91. data/tasks/ci.rake +1 -0
  92. data/tasks/metrics.rake +36 -0
  93. data/tasks/spec.rake +41 -0
  94. data/tasks/yard.rake +9 -0
  95. data/tasks/yardstick.rake +19 -0
  96. metadata +36 -18
  97. data/History.rdoc +0 -45
  98. data/Manifest.txt +0 -139
  99. data/TODO +0 -16
  100. data/lib/dm-validations/version.rb +0 -5
  101. data/tasks/install.rb +0 -13
  102. data/tasks/spec.rb +0 -25
@@ -6,7 +6,7 @@ describe 'Inferred validations' do
6
6
  custom_boat = Class.new do
7
7
  include DataMapper::Resource
8
8
  property :id, DataMapper::Types::Serial
9
- property :name, String, :nullable => false, :message => "This boat must have name"
9
+ property :name, String, :required => true, :message => "This boat must have name"
10
10
  end
11
11
  boat = custom_boat.new
12
12
  boat.should_not be_valid
@@ -17,7 +17,7 @@ describe 'Inferred validations' do
17
17
  custom_boat = Class.new do
18
18
  include DataMapper::Resource
19
19
  property :id, DataMapper::Types::Serial
20
- property :name, String, :nullable => false, :length => 5..20, :format => /^[a-z]+$/,
20
+ property :name, String, :required => true, :length => 5..20, :format => /^[a-z]+$/,
21
21
  :messages => {
22
22
  :presence => "This boat must have name",
23
23
  :length => "Name must have at least 4 and at most 20 chars",
@@ -7,8 +7,8 @@ describe "A class with inferred validations disabled for all properties with an
7
7
  include DataMapper::Resource
8
8
 
9
9
  property :id, DataMapper::Types::Serial, :auto_validation => false
10
- property :name, String, :nullable => false, :auto_validation => false
11
- property :bool, DataMapper::Types::Boolean, :nullable => false, :auto_validation => false
10
+ property :name, String, :required => true, :auto_validation => false
11
+ property :bool, DataMapper::Types::Boolean, :required => true, :auto_validation => false
12
12
  end
13
13
 
14
14
  @model = @klass.new
@@ -27,8 +27,8 @@ describe "A class with inferred validations disabled for all properties with a b
27
27
 
28
28
  without_auto_validations do
29
29
  property :id, DataMapper::Types::Serial
30
- property :name, String, :nullable => false
31
- property :bool, DataMapper::Types::Boolean, :nullable => false
30
+ property :name, String, :required => true
31
+ property :bool, DataMapper::Types::Boolean, :required => true
32
32
  end
33
33
  end
34
34
 
@@ -33,7 +33,7 @@ end
33
33
 
34
34
 
35
35
 
36
- describe "A model with a non-nullable Boolean property" do
36
+ describe "A model with a required Boolean property" do
37
37
  before :all do
38
38
  @model = HasNotNullableBoolean.new(:id => 1)
39
39
  end
@@ -69,7 +69,7 @@ end
69
69
 
70
70
 
71
71
 
72
- describe "A model with a non-nullable paranoid Boolean property" do
72
+ describe "A model with a required paranoid Boolean property" do
73
73
  before :all do
74
74
  @model = HasNotNullableParanoidBoolean.new(:id => 1)
75
75
  end
@@ -5,6 +5,8 @@ require 'integration/automatic_validation/spec_helper'
5
5
  { :float => Float, :big_decimal => BigDecimal }.each do |column, type|
6
6
  describe "#{type} property" do
7
7
  before :all do
8
+ SailBoat.auto_migrate!
9
+
8
10
  @model = SailBoat.new(:id => 1)
9
11
  end
10
12
 
@@ -1,8 +1,10 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/automatic_validation/spec_helper'
3
3
 
4
- describe SailBoat, "with a :format option on a property" do
4
+ describe 'SailBoat', "with a :format option on a property" do
5
5
  before :all do
6
+ SailBoat.auto_migrate!
7
+
6
8
  @model = SailBoat.new
7
9
  @model.should be_valid_for_format_test
8
10
  end
@@ -3,6 +3,8 @@ require 'integration/automatic_validation/spec_helper'
3
3
 
4
4
  describe "A model with an Integer property" do
5
5
  before :all do
6
+ SailBoat.auto_migrate!
7
+
6
8
  @model = SailBoat.new
7
9
  end
8
10
 
@@ -1,8 +1,10 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/automatic_validation/spec_helper'
3
3
 
4
- describe SailBoat do
4
+ describe 'SailBoat' do
5
5
  before :all do
6
+ SailBoat.auto_migrate!
7
+
6
8
  @model = SailBoat.new(:id => 1)
7
9
  @model.should be_valid_for_length_test_1
8
10
  end
@@ -78,8 +80,10 @@ end
78
80
 
79
81
 
80
82
 
81
- describe DataMapper::Validate::Fixtures::SmsMessage do
83
+ describe 'DataMapper::Validate::Fixtures::SmsMessage' do
82
84
  before :all do
85
+ DataMapper::Validate::Fixtures::SmsMessage.auto_migrate!
86
+
83
87
  @model = DataMapper::Validate::Fixtures::SmsMessage.new(:id => 10)
84
88
  end
85
89
 
@@ -1,8 +1,10 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/automatic_validation/spec_helper'
3
3
 
4
- describe SailBoat do
4
+ describe 'SailBoat' do
5
5
  before :all do
6
+ SailBoat.auto_migrate!
7
+
6
8
  @model = SailBoat.new(:id => 1)
7
9
  @model.name = 'Float'
8
10
  @model.should be_valid_for_presence_test
@@ -13,7 +15,7 @@ describe SailBoat do
13
15
  @model.name = nil
14
16
  end
15
17
 
16
- # has validates_is_present for name thanks to :nullable => false
18
+ # has validates_is_present for name thanks to :required => true
17
19
  it "is invalid" do
18
20
  @model.should_not be_valid_for_presence_test
19
21
  @model.errors.on(:name).should == [ 'Name must not be blank' ]
@@ -23,8 +25,10 @@ end
23
25
 
24
26
 
25
27
 
26
- describe SailBoat do
28
+ describe 'SailBoat' do
27
29
  before :all do
30
+ SailBoat.auto_migrate!
31
+
28
32
  @model = SailBoat.new(:id => 1)
29
33
  @model.name = 'Float'
30
34
  @model.should be_valid_for_presence_test
@@ -35,7 +39,7 @@ describe SailBoat do
35
39
  # no op
36
40
  end
37
41
 
38
- # has validates_is_present for name thanks to :nullable => false
42
+ # has validates_is_present for name thanks to :required => true
39
43
  it_should_behave_like "valid model"
40
44
  end
41
45
  end
@@ -1,8 +1,10 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/automatic_validation/spec_helper'
3
3
 
4
- describe SailBoat do
4
+ describe 'SailBoat' do
5
5
  before :all do
6
+ SailBoat.auto_migrate!
7
+
6
8
  @model = SailBoat.new(:id => 1)
7
9
  @model.should be_valid_for_primitive_test
8
10
  end
@@ -26,13 +26,13 @@ class SailBoat
26
26
  # use Serial in real world apps
27
27
  property :id, Integer, :key => true, :min => 1, :max => 10
28
28
 
29
- property :name, String, :nullable => false, :validates => :presence_test
29
+ property :name, String, :required => true, :validates => :presence_test
30
30
  property :description, String, :length => 10, :validates => :length_test_1
31
31
  property :notes, String, :length => 2..10, :validates => :length_test_2
32
32
  property :no_validation, String, :auto_validation => false
33
- property :salesman, String, :nullable => false, :validates => [:multi_context_1, :multi_context_2]
33
+ property :salesman, String, :required => true, :validates => [:multi_context_1, :multi_context_2]
34
34
  property :code, String, :format => Proc.new { |code| code =~ /A\d{4}\z/ }, :validates => :format_test
35
- property :allow_nil, String, :length => 5..10, :nullable => true, :validates => :nil_test
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
38
  property :big_decimal, BigDecimal, :precision => 2, :scale => 1
@@ -46,7 +46,7 @@ class HasNullableBoolean
46
46
  # this one is not Serial intentionally
47
47
  # use Serial in real world apps
48
48
  property :id, Integer, :key => true
49
- property :bool, Boolean # :nullable => true by default
49
+ property :bool, Boolean # :required => false by default
50
50
 
51
51
  include TypecastBypassSetter
52
52
  end
@@ -57,7 +57,7 @@ class HasNotNullableBoolean
57
57
  # this one is not Serial intentionally
58
58
  # use Serial in real world apps
59
59
  property :id, Integer, :key => true
60
- property :bool, Boolean, :nullable => false
60
+ property :bool, Boolean, :required => true
61
61
 
62
62
  include TypecastBypassSetter
63
63
  end
@@ -68,7 +68,7 @@ class HasNotNullableParanoidBoolean
68
68
  # this one is not Serial intentionally
69
69
  # use Serial in real world apps
70
70
  property :id, Integer, :key => true
71
- property :bool, ParanoidBoolean, :nullable => false
71
+ property :bool, ParanoidBoolean, :required => true
72
72
 
73
73
  include TypecastBypassSetter
74
74
  end
@@ -1,7 +1,7 @@
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::Validate::Fixtures::G3Concert' do
5
5
  before :all do
6
6
  @model = DataMapper::Validate::Fixtures::G3Concert.new(:year => 2004, :participants => "Joe Satriani, Steve Vai, Yngwie Malmsteen", :city => "Denver")
7
7
  @model.should be_valid
@@ -1,8 +1,10 @@
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::Validate::Fixtures::UDPPacket' do
5
5
  before :all do
6
+ DataMapper::Validate::Fixtures::UDPPacket.auto_migrate!
7
+
6
8
  @model = DataMapper::Validate::Fixtures::UDPPacket.new
7
9
  end
8
10
 
@@ -15,8 +15,10 @@ 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::Validate::Fixtures::Reservation' do
19
19
  before :all do
20
+ DataMapper::Validate::Fixtures::Reservation.auto_migrate!
21
+
20
22
  @model = DataMapper::Validate::Fixtures::Reservation.new(:person_name => "Tyler Durden",
21
23
  :person_name_confirmation => "Tyler Durden",
22
24
  :number_of_seats => 2,
@@ -1,7 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe DataMapper::Validate::Fixtures::Product do
3
+ describe 'DataMapper::Validate::Fixtures::Product' do
4
4
  before :all do
5
+ DataMapper::Validate::Fixtures::ProductCompany.auto_migrate!
6
+ DataMapper::Validate::Fixtures::Product.auto_migrate!
7
+
5
8
  @parent = DataMapper::Validate::Fixtures::ProductCompany.create(:title => "Apple", :flagship_product => "Macintosh")
6
9
  @parent.should be_valid
7
10
 
@@ -1,7 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe DataMapper::Validate::Fixtures::ServiceCompany do
3
+ describe 'DataMapper::Validate::Fixtures::ServiceCompany' do
4
4
  before :all do
5
+ DataMapper::Validate::Fixtures::ServiceCompany.auto_migrate!
6
+
5
7
  @model = DataMapper::Validate::Fixtures::ServiceCompany.new(:title => "Monsters, Inc.", :area_of_expertise => "Little children's nightmares")
6
8
  @model.valid?
7
9
  end
@@ -33,8 +35,10 @@ end
33
35
 
34
36
 
35
37
 
36
- describe DataMapper::Validate::Fixtures::ProductCompany do
38
+ describe 'DataMapper::Validate::Fixtures::ProductCompany' do
37
39
  before :all do
40
+ DataMapper::Validate::Fixtures::ProductCompany.auto_migrate!
41
+
38
42
  @model = DataMapper::Validate::Fixtures::ProductCompany.new(:title => "Apple", :flagship_product => "Macintosh")
39
43
  @model.valid?
40
44
  end
@@ -3,8 +3,10 @@
3
3
  require 'spec_helper'
4
4
  require 'integration/duplicated_validations/spec_helper'
5
5
 
6
- describe DataMapper::Validate::Fixtures::Page do
6
+ describe 'DataMapper::Validate::Fixtures::Page' do
7
7
  before :all do
8
+ DataMapper::Validate::Fixtures::Page.auto_migrate!
9
+
8
10
  @model = DataMapper::Validate::Fixtures::Page.new(:id => 1024)
9
11
  end
10
12
 
@@ -1,7 +1,11 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/format_validator/spec_helper'
3
3
 
4
- describe DataMapper::Validate::Fixtures::BillOfLading do
4
+ describe 'DataMapper::Validate::Fixtures::BillOfLading' do
5
+ before :all do
6
+ DataMapper::Validate::Fixtures::BillOfLading.auto_migrate!
7
+ end
8
+
5
9
  def valid_attributes
6
10
  { :id => 1, :doc_no => 'A1234', :email => 'user@example.com', :url => 'http://example.com' }
7
11
  end
@@ -1,7 +1,11 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/format_validator/spec_helper'
3
3
 
4
- describe DataMapper::Validate::Fixtures::BillOfLading do
4
+ describe 'DataMapper::Validate::Fixtures::BillOfLading' do
5
+ before :all do
6
+ DataMapper::Validate::Fixtures::BillOfLading.auto_migrate!
7
+ end
8
+
5
9
  def valid_attributes
6
10
  { :id => 1, :doc_no => 'A1234', :email => 'user@example.com', :url => 'http://example.com' }
7
11
  end
@@ -1,7 +1,11 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/format_validator/spec_helper'
3
3
 
4
- describe DataMapper::Validate::Fixtures::BillOfLading do
4
+ describe 'DataMapper::Validate::Fixtures::BillOfLading' do
5
+ before :all do
6
+ DataMapper::Validate::Fixtures::BillOfLading.auto_migrate!
7
+ end
8
+
5
9
  def valid_attributes
6
10
  { :id => 1, :doc_no => 'A1234', :email => 'user@example.com', :url => 'http://example.com' }
7
11
  end
@@ -1,7 +1,11 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/format_validator/spec_helper'
3
3
 
4
- describe DataMapper::Validate::Fixtures::BillOfLading do
4
+ describe 'DataMapper::Validate::Fixtures::BillOfLading' do
5
+ before :all do
6
+ DataMapper::Validate::Fixtures::BillOfLading.auto_migrate!
7
+ end
8
+
5
9
  def valid_attributes
6
10
  { :id => 1, :doc_no => 'A1234', :email => 'user@example.com', :url => 'http://example.com' }
7
11
  end
@@ -26,7 +30,7 @@ describe DataMapper::Validate::Fixtures::BillOfLading do
26
30
  @model.errors.on(:url).should == [ 'Url has an invalid format' ]
27
31
  end
28
32
  end
29
- end # each
33
+ end
30
34
 
31
35
 
32
36
  [ 'http://apple.com',
@@ -59,5 +63,5 @@ describe DataMapper::Validate::Fixtures::BillOfLading do
59
63
 
60
64
  it_should_behave_like "valid model"
61
65
  end
62
- end # each
63
- end # describe DataMapper::Validate::Fixtures::BillOfLading
66
+ end
67
+ end
@@ -1,9 +1,11 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/length_validator/spec_helper'
3
3
 
4
- describe ::DataMapper::Validate::Fixtures::BoatDock do
4
+ describe 'DataMapper::Validate::Fixtures::BoatDock' do
5
5
  before :all do
6
- @model = ::DataMapper::Validate::Fixtures::BoatDock.new
6
+ DataMapper::Validate::Fixtures::BoatDock.auto_migrate!
7
+
8
+ @model = DataMapper::Validate::Fixtures::BoatDock.new
7
9
  end
8
10
 
9
11
  describe "with default values that are valid" do
@@ -10,8 +10,10 @@ describe "entity with wrong destination MAC address length", :shared => true do
10
10
  end
11
11
 
12
12
 
13
- describe DataMapper::Validate::Fixtures::EthernetFrame do
13
+ describe 'DataMapper::Validate::Fixtures::EthernetFrame' do
14
14
  before :all do
15
+ DataMapper::Validate::Fixtures::EthernetFrame.auto_migrate!
16
+
15
17
  @model = DataMapper::Validate::Fixtures::EthernetFrame.valid_instance
16
18
  @model.link_support_fragmentation = false
17
19
  end
@@ -1,8 +1,10 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/length_validator/spec_helper'
3
3
 
4
- describe DataMapper::Validate::Fixtures::Jabberwock do
4
+ describe 'DataMapper::Validate::Fixtures::Jabberwock' do
5
5
  before :all do
6
+ DataMapper::Validate::Fixtures::Jabberwock.auto_migrate!
7
+
6
8
  @model = DataMapper::Validate::Fixtures::Jabberwock.new
7
9
  end
8
10
 
@@ -7,8 +7,10 @@ describe "barcode with invalid code length", :shared => true do
7
7
  end
8
8
  end
9
9
 
10
- describe ::DataMapper::Validate::Fixtures::Barcode do
10
+ describe 'DataMapper::Validate::Fixtures::Barcode' do
11
11
  before :all do
12
+ DataMapper::Validate::Fixtures::Barcode.auto_migrate!
13
+
12
14
  @model = DataMapper::Validate::Fixtures::Barcode.valid_instance
13
15
  end
14
16
 
@@ -7,8 +7,10 @@ describe "entity with a name shorter than 2 characters", :shared => true do
7
7
  end
8
8
  end
9
9
 
10
- describe ::DataMapper::Validate::Fixtures::Mittelschnauzer do
10
+ describe 'DataMapper::Validate::Fixtures::Mittelschnauzer' do
11
11
  before :all do
12
+ DataMapper::Validate::Fixtures::Mittelschnauzer.auto_migrate!
13
+
12
14
  @model = DataMapper::Validate::Fixtures::Mittelschnauzer.valid_instance
13
15
  end
14
16
 
@@ -1,8 +1,10 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/length_validator/spec_helper'
3
3
 
4
- describe DataMapper::Validate::Fixtures::EthernetFrame do
4
+ describe 'DataMapper::Validate::Fixtures::EthernetFrame' do
5
5
  before :all do
6
+ DataMapper::Validate::Fixtures::EthernetFrame.auto_migrate!
7
+
6
8
  @model = DataMapper::Validate::Fixtures::EthernetFrame.valid_instance
7
9
  @model.link_support_fragmentation = false
8
10
  end