cowtech-extensions 2.7.1 → 2.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +4 -2
- data/README.md +4 -1
- data/doc/Cowtech.html +2 -2
- data/doc/Cowtech/Extensions.html +96 -93
- data/doc/Cowtech/Extensions/Boolean.html +10 -8
- data/doc/Cowtech/Extensions/DateTime.html +58 -52
- data/doc/Cowtech/Extensions/DateTime/ClassMethods.html +91 -79
- data/doc/Cowtech/Extensions/Exceptions.html +2 -2
- data/doc/Cowtech/Extensions/Exceptions/Dump.html +2 -2
- data/doc/Cowtech/Extensions/Hash.html +20 -18
- data/doc/Cowtech/Extensions/Math.html +2 -2
- data/doc/Cowtech/Extensions/Math/ClassMethods.html +24 -22
- data/doc/Cowtech/Extensions/Object.html +95 -81
- data/doc/Cowtech/Extensions/Pathname.html +11 -10
- data/doc/Cowtech/Extensions/Settings.html +80 -70
- data/doc/Cowtech/Extensions/String.html +26 -22
- data/doc/Cowtech/Extensions/TimeZone.html +98 -86
- data/doc/Cowtech/Extensions/TimeZone/ClassMethods.html +79 -72
- data/doc/Cowtech/Extensions/Version.html +11 -7
- data/doc/_index.html +2 -2
- data/doc/file.README.html +9 -6
- data/doc/index.html +9 -6
- data/doc/top-level-namespace.html +2 -2
- data/lib/cowtech-extensions.rb +2 -1
- data/lib/cowtech-extensions/version.rb +2 -2
- data/spec/cowtech-extensions/boolean_spec.rb +9 -4
- data/spec/cowtech-extensions/datetime_spec.rb +106 -100
- data/spec/cowtech-extensions/hash_spec.rb +4 -4
- data/spec/cowtech-extensions/math_spec.rb +8 -8
- data/spec/cowtech-extensions/object_spec.rb +115 -103
- data/spec/cowtech-extensions/pathname_spec.rb +3 -1
- data/spec/cowtech-extensions/settings_spec.rb +30 -30
- data/spec/cowtech-extensions/string_spec.rb +13 -7
- data/spec/cowtech-extensions_spec.rb +21 -11
- data/spec/spec_helper.rb +7 -1
- metadata +4 -4
@@ -17,23 +17,29 @@ describe Cowtech::Extensions::String do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
describe "#remove_accents" do
|
20
|
-
it "should translate accents" do
|
20
|
+
it "should translate accents" do
|
21
|
+
expect(reference.remove_accents).to eq(translated_reference)
|
22
|
+
end
|
21
23
|
end
|
22
24
|
|
23
25
|
describe "#untitleize" do
|
24
|
-
it "should convert spaces to dashes" do
|
26
|
+
it "should convert spaces to dashes" do
|
27
|
+
expect(reference.untitleize).to eq(untitleized_reference)
|
28
|
+
end
|
25
29
|
end
|
26
30
|
|
27
31
|
describe "#replace_ampersands" do
|
28
|
-
it "should remove HTML ampersands" do
|
32
|
+
it "should remove HTML ampersands" do
|
33
|
+
expect(reference.replace_ampersands).to eq(amp_reference)
|
34
|
+
end
|
29
35
|
end
|
30
36
|
|
31
37
|
describe "#value" do
|
32
38
|
it "should return the string itself" do
|
33
|
-
reference.value.
|
34
|
-
translated_reference.value.
|
35
|
-
untitleized_reference.value.
|
36
|
-
amp_reference.value.
|
39
|
+
expect(reference.value).to eq(reference)
|
40
|
+
expect(translated_reference.value).to eq(translated_reference)
|
41
|
+
expect(untitleized_reference.value).to eq(untitleized_reference)
|
42
|
+
expect(amp_reference.value).to eq(amp_reference)
|
37
43
|
end
|
38
44
|
end
|
39
45
|
end
|
@@ -6,7 +6,7 @@ describe Cowtech::Extensions do
|
|
6
6
|
original_ruby_version = RUBY_VERSION
|
7
7
|
|
8
8
|
::Kernel::silence_warnings { Object.const_set("RUBY_VERSION", "1.8.7") }
|
9
|
-
::Cowtech::Extensions.is_ruby_18
|
9
|
+
expect(::Cowtech::Extensions.is_ruby_18?).to be_true
|
10
10
|
::Kernel::silence_warnings { Object.const_set("RUBY_VERSION", original_ruby_version) }
|
11
11
|
end
|
12
12
|
|
@@ -14,7 +14,7 @@ describe Cowtech::Extensions do
|
|
14
14
|
original_ruby_version = RUBY_VERSION
|
15
15
|
|
16
16
|
::Kernel::silence_warnings { Object.const_set("RUBY_VERSION", "1.9.3") }
|
17
|
-
::Cowtech::Extensions.is_ruby_18
|
17
|
+
expect(::Cowtech::Extensions.is_ruby_18?).to be_false
|
18
18
|
::Kernel::silence_warnings { Object.const_set("RUBY_VERSION", original_ruby_version) }
|
19
19
|
end
|
20
20
|
end
|
@@ -24,24 +24,34 @@ describe Cowtech::Extensions do
|
|
24
24
|
::Cowtech::Extensions.load!
|
25
25
|
|
26
26
|
it "for Boolean" do
|
27
|
-
true.
|
28
|
-
true.
|
27
|
+
expect(true).to respond_to("value")
|
28
|
+
expect(true).to respond_to("to_i")
|
29
29
|
end
|
30
30
|
|
31
31
|
it "for DateTime" do
|
32
|
-
::DateTime.
|
33
|
-
::DateTime.now.
|
32
|
+
expect(::DateTime).to respond_to("custom_format")
|
33
|
+
expect(::DateTime.now).to respond_to("lstrftime")
|
34
34
|
end
|
35
35
|
|
36
|
-
it "for Hash" do
|
36
|
+
it "for Hash" do
|
37
|
+
expect({:a => "b"}).to respond_to("a")
|
38
|
+
end
|
37
39
|
|
38
|
-
it "for Math" do
|
40
|
+
it "for Math" do
|
41
|
+
expect(::Math).to respond_to("min")
|
42
|
+
end
|
39
43
|
|
40
|
-
it "for Object" do
|
44
|
+
it "for Object" do
|
45
|
+
expect(0).to respond_to("debug_dump")
|
46
|
+
end
|
41
47
|
|
42
|
-
it "for Pathname" do
|
48
|
+
it "for Pathname" do
|
49
|
+
expect(::Pathname.new($0)).to respond_to("components")
|
50
|
+
end
|
43
51
|
|
44
|
-
it "for String" do
|
52
|
+
it "for String" do
|
53
|
+
expect("").to respond_to("remove_accents")
|
54
|
+
end
|
45
55
|
end
|
46
56
|
end
|
47
57
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cowtech-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 2.7.
|
9
|
+
- 2
|
10
|
+
version: 2.7.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Shogun
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-07-
|
18
|
+
date: 2012-07-28 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|