escape_utils 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/escape_utils/escape_utils.c +1 -0
- data/lib/escape_utils/version.rb +1 -1
- data/test/html/escape_test.rb +24 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e8e894a1012e4b7e8f3faaa7a942a5ba2c1711d
|
4
|
+
data.tar.gz: 79c30477e80a0a3a1998f736ea63d83901a8d52f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b8214e9b94dbc9cfc80de25aaa5e0e84262bc14cba81c5a682db42acfaa5197cc5fda8657afaf88ae7d930a2711df09ca6c431be65c78e4592eed4037c529cc
|
7
|
+
data.tar.gz: def42fd99a18ba77515d7ad53484bb815adfac586151a9072d1e238cc25853f86af85c44479e3232a3da587b4404c7cfe208d5be997d54e28f5d51420d0dc46d
|
data/lib/escape_utils/version.rb
CHANGED
data/test/html/escape_test.rb
CHANGED
@@ -4,6 +4,30 @@ class MyCustomHtmlSafeString < String
|
|
4
4
|
end
|
5
5
|
|
6
6
|
class HtmlEscapeTest < Minitest::Test
|
7
|
+
def test_escape_source_encoding_is_maintained
|
8
|
+
source = 'foobar'
|
9
|
+
str = EscapeUtils.escape_html_as_html_safe(source)
|
10
|
+
assert_equal source.encoding, str.encoding
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_escape_binary_encoding_is_maintained
|
14
|
+
source = 'foobar'.b
|
15
|
+
str = EscapeUtils.escape_html_as_html_safe(source)
|
16
|
+
assert_equal source.encoding, str.encoding
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_escape_uft8_encoding_is_maintained
|
20
|
+
source = 'foobar'.encode 'UTF-8'
|
21
|
+
str = EscapeUtils.escape_html_as_html_safe(source)
|
22
|
+
assert_equal source.encoding, str.encoding
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_escape_us_ascii_encoding_is_maintained
|
26
|
+
source = 'foobar'.encode 'US-ASCII'
|
27
|
+
str = EscapeUtils.escape_html_as_html_safe(source)
|
28
|
+
assert_equal source.encoding, str.encoding
|
29
|
+
end
|
30
|
+
|
7
31
|
def test_escape_basic_html_with_secure
|
8
32
|
assert_equal "<some_tag/>", EscapeUtils.escape_html("<some_tag/>")
|
9
33
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: escape_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Lopez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
207
|
version: '0'
|
208
208
|
requirements: []
|
209
209
|
rubyforge_project:
|
210
|
-
rubygems_version: 2.
|
210
|
+
rubygems_version: 2.5.1
|
211
211
|
signing_key:
|
212
212
|
specification_version: 4
|
213
213
|
summary: Faster string escaping routines for your web apps
|