Skip to content
This repository
Browse code

Merge pull request #3682 from sikachu/3-1-stable-fix_test_variable

Update variable's name in the test case to reflect the class we're testing
  • Loading branch information...
commit a099116c12c880753520da6cd97fe0fefa279f2c 2 parents ae4974a + fc44737
Vijay Dev authored November 18, 2011
12  activemodel/test/cases/validations/exclusion_validation_test.rb
@@ -46,12 +46,12 @@ def test_validates_exclusion_of_for_ruby_class
46 46
   def test_validates_exclusion_of_with_lambda
47 47
     Topic.validates_exclusion_of :title, :in => lambda{ |topic| topic.author_name == "sikachu" ? %w( monkey elephant ) : %w( abe wasabi ) }
48 48
 
49  
-    p = Topic.new
50  
-    p.title = "elephant"
51  
-    p.author_name = "sikachu"
52  
-    assert p.invalid?
  49
+    t = Topic.new
  50
+    t.title = "elephant"
  51
+    t.author_name = "sikachu"
  52
+    assert t.invalid?
53 53
 
54  
-    p.title = "wasabi"
55  
-    assert p.valid?
  54
+    t.title = "wasabi"
  55
+    assert t.valid?
56 56
   end
57 57
 end
24  activemodel/test/cases/validations/format_validation_test.rb
@@ -101,25 +101,25 @@ def test_validates_format_of_when_not_isnt_a_regexp_should_raise_error
101 101
   def test_validates_format_of_with_lambda
102 102
     Topic.validates_format_of :content, :with => lambda{ |topic| topic.title == "digit" ? /\A\d+\Z/ : /\A\S+\Z/ }
103 103
 
104  
-    p = Topic.new
105  
-    p.title = "digit"
106  
-    p.content = "Pixies"
107  
-    assert p.invalid?
  104
+    t = Topic.new
  105
+    t.title = "digit"
  106
+    t.content = "Pixies"
  107
+    assert t.invalid?
108 108
 
109  
-    p.content = "1234"
110  
-    assert p.valid?
  109
+    t.content = "1234"
  110
+    assert t.valid?
111 111
   end
112 112
 
113 113
   def test_validates_format_of_without_lambda
114 114
     Topic.validates_format_of :content, :without => lambda{ |topic| topic.title == "characters" ? /\A\d+\Z/ : /\A\S+\Z/ }
115 115
 
116  
-    p = Topic.new
117  
-    p.title = "characters"
118  
-    p.content = "1234"
119  
-    assert p.invalid?
  116
+    t = Topic.new
  117
+    t.title = "characters"
  118
+    t.content = "1234"
  119
+    assert t.invalid?
120 120
 
121  
-    p.content = "Pixies"
122  
-    assert p.valid?
  121
+    t.content = "Pixies"
  122
+    assert t.valid?
123 123
   end
124 124
 
125 125
   def test_validates_format_of_for_ruby_class
12  activemodel/test/cases/validations/inclusion_validation_test.rb
@@ -78,12 +78,12 @@ def test_validates_inclusion_of_for_ruby_class
78 78
   def test_validates_inclusion_of_with_lambda
79 79
     Topic.validates_inclusion_of :title, :in => lambda{ |topic| topic.author_name == "sikachu" ? %w( monkey elephant ) : %w( abe wasabi ) }
80 80
 
81  
-    p = Topic.new
82  
-    p.title = "wasabi"
83  
-    p.author_name = "sikachu"
84  
-    assert p.invalid?
  81
+    t = Topic.new
  82
+    t.title = "wasabi"
  83
+    t.author_name = "sikachu"
  84
+    assert t.invalid?
85 85
 
86  
-    p.title = "elephant"
87  
-    assert p.valid?
  86
+    t.title = "elephant"
  87
+    assert t.valid?
88 88
   end
89 89
 end

0 notes on commit a099116

Please sign in to comment.
Something went wrong with that request. Please try again.