zeke-monkey_patches 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/lib/monkey_patches.rb +6 -0
- data/spec/monkey_patches_spec.rb +7 -1
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/monkey_patches.rb
CHANGED
@@ -152,6 +152,12 @@ class String
|
|
152
152
|
def upcase?
|
153
153
|
self.upcase == self
|
154
154
|
end
|
155
|
+
|
156
|
+
# Returns true if all letters in the string are lowercase
|
157
|
+
def downcase?
|
158
|
+
self.downcase == self
|
159
|
+
end
|
160
|
+
|
155
161
|
|
156
162
|
def replace_wonky_characters_with_ascii
|
157
163
|
t = self.to_s
|
data/spec/monkey_patches_spec.rb
CHANGED
@@ -95,11 +95,17 @@ describe "MonkeyPatches" do
|
|
95
95
|
" this \t is also a test ".remove_whitespace.should == "this is also a test"
|
96
96
|
end
|
97
97
|
|
98
|
-
it "determines
|
98
|
+
it "determines whether string is capitalized" do
|
99
99
|
"This is mixed case".upcase?.should == false
|
100
100
|
"ALL CAPS DUDE".upcase?.should == true
|
101
101
|
"ALL-CAPS, WITH! EXTRA.. CHARS & STUFF/SYMBOLS?".upcase?.should == true
|
102
102
|
end
|
103
|
+
|
104
|
+
it "determines whether string is lowercase" do
|
105
|
+
"This is mixed case".downcase?.should == false
|
106
|
+
"all lowers dude".downcase?.should == true
|
107
|
+
"all-caps, with! extra.. chars & stuff/symbols?".downcase?.should == true
|
108
|
+
end
|
103
109
|
|
104
110
|
# Array specs
|
105
111
|
|