normatron 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/normatron/extensions/active_record.rb +3 -2
- data/lib/normatron/filters/camelize_filter.rb +2 -1
- data/lib/normatron/filters/underscore_filter.rb +6 -6
- data/lib/normatron/version.rb +1 -1
- data/spec/normatron/configuration_spec.rb +50 -51
- data/spec/normatron/filters/ascii_filter_spec.rb +0 -2
- data/spec/normatron/filters/blank_filter_spec.rb +6 -6
- data/spec/normatron/filters/camelize_filter_spec.rb +4 -5
- data/spec/normatron/filters/capitalize_filter_spec.rb +13 -10
- data/spec/normatron/filters/chomp_filter_spec.rb +13 -10
- data/spec/normatron/filters/dasherize_filter_spec.rb +8 -4
- data/spec/normatron/filters/downcase_filter_spec.rb +10 -6
- data/spec/normatron/filters/dump_filter_spec.rb +10 -6
- data/spec/normatron/filters/keep_filter_spec.rb +88 -82
- data/spec/normatron/filters/remove_filter_spec.rb +88 -82
- data/spec/normatron/filters/squeeze_filter_spec.rb +10 -6
- data/spec/normatron/filters/squish_filter_spec.rb +12 -8
- data/spec/normatron/filters/strip_filter_spec.rb +12 -8
- data/spec/normatron/filters/swapcase_filter_spec.rb +12 -8
- data/spec/normatron/filters/titleize_filter_spec.rb +12 -8
- data/spec/normatron/filters/underscore_filter_spec.rb +32 -18
- data/spec/normatron/filters/upcase_filter_spec.rb +10 -6
- data/spec/support/matchers/character_cleaner_matcher.rb +73 -0
- data/spec/support/matchers/evaluate_matcher.rb +9 -3
- metadata +4 -2
@@ -35,7 +35,6 @@ module Normatron
|
|
35
35
|
end
|
36
36
|
|
37
37
|
# Append new filters to rules
|
38
|
-
@normalize_rules ||= {}
|
39
38
|
@normalize_rules =
|
40
39
|
args.reduce(@normalize_rules) do |hash, att|
|
41
40
|
filters = (@normalize_rules[att] || {}).merge(new_filters)
|
@@ -46,9 +45,11 @@ module Normatron
|
|
46
45
|
|
47
46
|
module InstanceMethods
|
48
47
|
def apply_normalizations
|
48
|
+
return unless self.class.normalize_rules
|
49
|
+
|
49
50
|
listed_filters = Normatron.configuration.filters
|
50
51
|
|
51
|
-
self.class.
|
52
|
+
self.class.normalize_rules.each do |attribute, filters|
|
52
53
|
value = send("#{attribute}_before_type_cast") || send(attribute)
|
53
54
|
|
54
55
|
filters.each do |filter, args|
|
@@ -48,7 +48,8 @@ module Normatron
|
|
48
48
|
|
49
49
|
string = mb_send(:downcase, input)
|
50
50
|
string.sub!(/^[^_|\/]+/) { camel == :upper ? acronyms[$&] || mb_send(:capitalize, $&) : $& }
|
51
|
-
string.gsub(/(?:(\/)|_)([^\/|_]+)/) { "#{$1}#{acronyms[$2] || mb_send(:capitalize, $2)}" }
|
51
|
+
string.gsub!(/(?:(\/)|_)([^\/|_]+)/) { "#{$1}#{acronyms[$2] || mb_send(:capitalize, $2)}" }
|
52
|
+
string.gsub("/", "::")
|
52
53
|
end
|
53
54
|
end
|
54
55
|
end
|
@@ -39,12 +39,12 @@ module Normatron
|
|
39
39
|
def self.evaluate(input)
|
40
40
|
return input unless input.kind_of?(String)
|
41
41
|
|
42
|
-
input.gsub
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
mb_send(:downcase,
|
42
|
+
string = input.gsub(/::/, '/')
|
43
|
+
string.gsub!(/#{acronym_regex}/) { "_#{$&}_".downcase }
|
44
|
+
string.gsub!(/\b_|_\b/, "")
|
45
|
+
string.gsub!(/([^\/\b_])(?=[\p{Lu}])/u) { "#{$&}_" }
|
46
|
+
string.tr!("-", "_")
|
47
|
+
mb_send(:downcase, string)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
data/lib/normatron/version.rb
CHANGED
@@ -1,68 +1,67 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
3
|
+
module Normatron
|
4
|
+
describe Configuration do
|
4
5
|
|
5
|
-
|
6
|
-
@instance
|
7
|
-
end
|
6
|
+
before(:each) { @instance = described_class.new }
|
7
|
+
subject { @instance }
|
8
8
|
|
9
|
-
|
9
|
+
describe :default_filters do
|
10
|
+
it "should have default values" do
|
11
|
+
subject.default_filters.should == { blank: nil, squish: nil }
|
12
|
+
end
|
10
13
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
+
it "should parse and set filters properly" do
|
15
|
+
subject.default_filters = :upcase, :blank, { keep: [:L, :N] }, [:remove, :S, :Z]
|
16
|
+
subject.default_filters.should == { upcase: nil, blank: nil, keep: [:L, :N], remove: [:S, :Z] }
|
17
|
+
end
|
14
18
|
end
|
15
19
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
20
|
+
describe :filters do
|
21
|
+
context "when initialized" do
|
22
|
+
it { subject.filters[:ascii] .should eq Normatron::Filters::AsciiFilter }
|
23
|
+
it { subject.filters[:blank] .should eq Normatron::Filters::BlankFilter }
|
24
|
+
it { subject.filters[:camelize] .should eq Normatron::Filters::CamelizeFilter }
|
25
|
+
it { subject.filters[:capitalize].should eq Normatron::Filters::CapitalizeFilter }
|
26
|
+
it { subject.filters[:chomp] .should eq Normatron::Filters::ChompFilter }
|
27
|
+
it { subject.filters[:dasherize] .should eq Normatron::Filters::DasherizeFilter }
|
28
|
+
it { subject.filters[:downcase] .should eq Normatron::Filters::DowncaseFilter }
|
29
|
+
it { subject.filters[:dump] .should eq Normatron::Filters::DumpFilter }
|
30
|
+
it { subject.filters[:keep] .should eq Normatron::Filters::KeepFilter }
|
31
|
+
it { subject.filters[:remove] .should eq Normatron::Filters::RemoveFilter }
|
32
|
+
it { subject.filters[:squeeze] .should eq Normatron::Filters::SqueezeFilter }
|
33
|
+
it { subject.filters[:squish] .should eq Normatron::Filters::SquishFilter }
|
34
|
+
it { subject.filters[:strip] .should eq Normatron::Filters::StripFilter }
|
35
|
+
it { subject.filters[:swapcase] .should eq Normatron::Filters::SwapcaseFilter }
|
36
|
+
it { subject.filters[:titleize] .should eq Normatron::Filters::TitleizeFilter }
|
37
|
+
it { subject.filters[:underscore].should eq Normatron::Filters::UnderscoreFilter }
|
38
|
+
it { subject.filters[:upcase] .should eq Normatron::Filters::UpcaseFilter }
|
39
|
+
end
|
21
40
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
it { subject.filters[:capitalize].should eq Normatron::Filters::CapitalizeFilter }
|
28
|
-
it { subject.filters[:chomp] .should eq Normatron::Filters::ChompFilter }
|
29
|
-
it { subject.filters[:dasherize] .should eq Normatron::Filters::DasherizeFilter }
|
30
|
-
it { subject.filters[:downcase] .should eq Normatron::Filters::DowncaseFilter }
|
31
|
-
it { subject.filters[:dump] .should eq Normatron::Filters::DumpFilter }
|
32
|
-
it { subject.filters[:keep] .should eq Normatron::Filters::KeepFilter }
|
33
|
-
it { subject.filters[:remove] .should eq Normatron::Filters::RemoveFilter }
|
34
|
-
it { subject.filters[:squeeze] .should eq Normatron::Filters::SqueezeFilter }
|
35
|
-
it { subject.filters[:squish] .should eq Normatron::Filters::SquishFilter }
|
36
|
-
it { subject.filters[:strip] .should eq Normatron::Filters::StripFilter }
|
37
|
-
it { subject.filters[:swapcase] .should eq Normatron::Filters::SwapcaseFilter }
|
38
|
-
it { subject.filters[:titleize] .should eq Normatron::Filters::TitleizeFilter }
|
39
|
-
it { subject.filters[:underscore].should eq Normatron::Filters::UnderscoreFilter }
|
40
|
-
it { subject.filters[:upcase] .should eq Normatron::Filters::UpcaseFilter }
|
41
|
-
end
|
41
|
+
context "when new filter is added" do
|
42
|
+
it "module filter should be set" do
|
43
|
+
subject.filters[:smile] = MyFilters::SmileFilter
|
44
|
+
subject.filters[:smile].should eq MyFilters::SmileFilter
|
45
|
+
end
|
42
46
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
+
it "lambda filter should be set" do
|
48
|
+
lambda_filter = lambda { |input, value| input << value }
|
49
|
+
subject.filters[:append] = lambda_filter
|
50
|
+
subject.filters[:append].should eq lambda_filter
|
51
|
+
end
|
47
52
|
end
|
48
53
|
|
49
|
-
it "
|
50
|
-
|
51
|
-
subject.filters[:append] = lambda_filter
|
52
|
-
subject.filters[:append].should eq lambda_filter
|
54
|
+
it "should allow remove filters" do
|
55
|
+
lambda { subject.filters.delete(subject.filters.keys.first) }.should_not raise_error
|
53
56
|
end
|
54
57
|
end
|
55
58
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
it "should include ActiveRecord extension" do
|
63
|
-
ActiveRecord::Base.include?(Normatron::Extensions::ActiveRecord).should be_false
|
64
|
-
subject.add_orm Normatron::Extensions::ActiveRecord
|
65
|
-
ActiveRecord::Base.include?(Normatron::Extensions::ActiveRecord).should be_true
|
59
|
+
describe :add_orm do
|
60
|
+
it "should include ActiveRecord extension" do
|
61
|
+
ActiveRecord::Base.include?(Normatron::Extensions::ActiveRecord).should be_false
|
62
|
+
subject.add_orm Normatron::Extensions::ActiveRecord
|
63
|
+
ActiveRecord::Base.include?(Normatron::Extensions::ActiveRecord).should be_true
|
64
|
+
end
|
66
65
|
end
|
67
66
|
end
|
68
67
|
end
|
@@ -13,8 +13,6 @@ module Normatron
|
|
13
13
|
it { should evaluate("⠋⠗⠁⠝⠉⠑" ).to("france" ) }
|
14
14
|
it { should evaluate(100 ).to(100 ) }
|
15
15
|
it { should evaluate(nil ).to(nil ) }
|
16
|
-
|
17
|
-
pending "Open a pull request to Stringex.\n'¬' (not sign) character is not evaluating as expected (minus sign or tilde)."
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -3,12 +3,12 @@ require 'spec_helper'
|
|
3
3
|
module Normatron
|
4
4
|
module Filters
|
5
5
|
describe BlankFilter do
|
6
|
-
it {
|
7
|
-
it {
|
8
|
-
it {
|
9
|
-
it {
|
10
|
-
it {
|
11
|
-
it {
|
6
|
+
it { should evaluate(" ").to(nil ).constraints({identity: false, type: false}) }
|
7
|
+
it { should evaluate("\n \t \r \f").to(nil ).constraints({identity: false, type: false}) }
|
8
|
+
it { should evaluate("\n\t\r\f" ).to(nil ).constraints({identity: false, type: false}) }
|
9
|
+
it { should evaluate("phase" ).to("phase").constraints({identity: false, type: true }) }
|
10
|
+
it { should evaluate(100 ).to(100 ).constraints({identity: false, type: true }) }
|
11
|
+
it { should evaluate(nil ).to(nil ).constraints({identity: false, type: true }) }
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/camelize_filter'
|
5
4
|
|
6
5
|
module Normatron
|
7
6
|
module Filters
|
@@ -93,10 +92,10 @@ module Normatron
|
|
93
92
|
inflections.acronyms.delete("doctype")
|
94
93
|
end
|
95
94
|
|
96
|
-
it { should evaluate("http_address/
|
97
|
-
it { should evaluate("http_address/
|
98
|
-
it { should evaluate("doctype_stop/run_ssl/xml/mix_http").to("docTypeStop::RunSSL::Xml::MixHTTP"
|
99
|
-
it { should evaluate("doctype_stop/run_ssl/xml/mix_http").to("doctypeStop::RunSSL::Xml::MixHTTP"
|
95
|
+
it { should evaluate("http_address/ssl_lib/xml_file/doctype").to("HTTPAddress::SSLLib::XmlFile::docType") }
|
96
|
+
it { should evaluate("http_address/ssl_lib/xml_file/doctype").to("httpAddress::SSLLib::XmlFile::docType").with(:lower) }
|
97
|
+
it { should evaluate("doctype_stop/run_ssl/xml/mix_http" ).to("docTypeStop::RunSSL::Xml::MixHTTP" ) }
|
98
|
+
it { should evaluate("doctype_stop/run_ssl/xml/mix_http" ).to("doctypeStop::RunSSL::Xml::MixHTTP" ).with(:lower) }
|
100
99
|
end
|
101
100
|
end
|
102
101
|
end
|
@@ -1,15 +1,18 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/capitalize_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe CapitalizeFilter do
|
8
|
+
it { should evaluate("i love winter" ).to("I love winter" ) }
|
9
|
+
it { should evaluate("I LOVE WINTER" ).to("I love winter" ) }
|
10
|
+
it { should evaluate("ó, vida cruel!").to("Ó, vida cruel!") }
|
11
|
+
it { should evaluate("Ó, VIDA CRUEL!").to("Ó, vida cruel!") }
|
12
|
+
it { should evaluate("1 minute" ).to("1 minute" ) }
|
13
|
+
it { should evaluate("1 MINUTE" ).to("1 minute" ) }
|
14
|
+
it { should evaluate(100 ).to(100 ) }
|
15
|
+
it { should evaluate(nil ).to(nil ) }
|
16
|
+
end
|
17
|
+
end
|
15
18
|
end
|
@@ -1,15 +1,18 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/chomp_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe ChompFilter do
|
8
|
+
it { should evaluate("show me the money" ).to("show me the money" ) }
|
9
|
+
it { should evaluate("show me the money\n" ).to("show me the money" ) }
|
10
|
+
it { should evaluate("show me the money\r" ).to("show me the money" ) }
|
11
|
+
it { should evaluate("show me the money\r\n").to("show me the money" ) }
|
12
|
+
it { should evaluate("show me the money\n\r").to("show me the money\n") }
|
13
|
+
it { should evaluate("show me the money" ).to("show me the" ).with(" money") }
|
14
|
+
it { should evaluate(100 ).to(100 ) }
|
15
|
+
it { should evaluate(nil ).to(nil ) }
|
16
|
+
end
|
17
|
+
end
|
15
18
|
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/dasherize_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe DasherizeFilter do
|
8
|
+
it { should evaluate("string_inflections").to("string-inflections") }
|
9
|
+
it { should evaluate(100 ).to(100 ) }
|
10
|
+
it { should evaluate(nil ).to(nil ) }
|
11
|
+
end
|
12
|
+
end
|
9
13
|
end
|
@@ -1,10 +1,14 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/downcase_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe DowncaseFilter do
|
8
|
+
it { should evaluate("caçador").to("caçador") }
|
9
|
+
it { should evaluate("CAÇADOR").to("caçador") }
|
10
|
+
it { should evaluate(100 ).to(100 ) }
|
11
|
+
it { should evaluate(nil ).to(nil ) }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,10 +1,14 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/dump_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe DumpFilter do
|
8
|
+
it { should evaluate("First \n Time").to('"First \n Time"' ) }
|
9
|
+
it { should evaluate('First \n Time').to('"First \\\n Time"') }
|
10
|
+
it { should evaluate(100 ).to(100 ) }
|
11
|
+
it { should evaluate(nil ).to(nil ) }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,86 +1,92 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/keep_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe KeepFilter do
|
8
|
+
let(:word) {"ᰄ긚 ᧔瑤л꽥๏ ѨDꨥ\aՇ謬ꗀᶆᵆ쳻ῼἬ鿃ႍꥈᤫ꙲⅟౮ⅰ⅘༌_゠⟦〉⸠›⸓⌟⅂₧௹¨⣭ \u2028\u2029\u008C\u0011\uA7E5" }
|
9
|
+
|
10
|
+
it { should keep(:Graph ).from(word) }
|
11
|
+
it { should keep(:Punct ).from(word) }
|
12
|
+
it { should keep(:Upper ).from(word) }
|
13
|
+
it { should keep(:Word ).from(word) }
|
14
|
+
it { should keep(:Latin ).from(word) }
|
15
|
+
it { should keep(:L ).from(word) }
|
16
|
+
it { should keep(:M ).from(word) }
|
17
|
+
it { should keep(:N ).from(word) }
|
18
|
+
it { should keep(:P ).from(word) }
|
19
|
+
it { should keep(:S ).from(word) }
|
20
|
+
it { should keep(:Z ).from(word) }
|
21
|
+
it { should keep(:C ).from(word) }
|
22
|
+
it { should keep(:Graph, :Punct).from(word) }
|
23
|
+
it { should keep(:Graph, :Upper).from(word) }
|
24
|
+
it { should keep(:Graph, :Word ).from(word) }
|
25
|
+
it { should keep(:Graph, :Latin).from(word) }
|
26
|
+
it { should keep(:Graph, :L ).from(word) }
|
27
|
+
it { should keep(:Graph, :M ).from(word) }
|
28
|
+
it { should keep(:Graph, :N ).from(word) }
|
29
|
+
it { should keep(:Graph, :P ).from(word) }
|
30
|
+
it { should keep(:Graph, :S ).from(word) }
|
31
|
+
it { should keep(:Graph, :Z ).from(word) }
|
32
|
+
it { should keep(:Graph, :C ).from(word) }
|
33
|
+
it { should keep(:Punct, :Upper).from(word) }
|
34
|
+
it { should keep(:Punct, :Word ).from(word) }
|
35
|
+
it { should keep(:Punct, :Latin).from(word) }
|
36
|
+
it { should keep(:Punct, :L ).from(word) }
|
37
|
+
it { should keep(:Punct, :M ).from(word) }
|
38
|
+
it { should keep(:Punct, :N ).from(word) }
|
39
|
+
it { should keep(:Punct, :P ).from(word) }
|
40
|
+
it { should keep(:Punct, :S ).from(word) }
|
41
|
+
it { should keep(:Punct, :Z ).from(word) }
|
42
|
+
it { should keep(:Punct, :C ).from(word) }
|
43
|
+
it { should keep(:Upper, :Word ).from(word) }
|
44
|
+
it { should keep(:Upper, :Latin).from(word) }
|
45
|
+
it { should keep(:Upper, :L ).from(word) }
|
46
|
+
it { should keep(:Upper, :M ).from(word) }
|
47
|
+
it { should keep(:Upper, :N ).from(word) }
|
48
|
+
it { should keep(:Upper, :P ).from(word) }
|
49
|
+
it { should keep(:Upper, :S ).from(word) }
|
50
|
+
it { should keep(:Upper, :Z ).from(word) }
|
51
|
+
it { should keep(:Upper, :C ).from(word) }
|
52
|
+
it { should keep(:Word, :Latin ).from(word) }
|
53
|
+
it { should keep(:Word, :L ).from(word) }
|
54
|
+
it { should keep(:Word, :M ).from(word) }
|
55
|
+
it { should keep(:Word, :N ).from(word) }
|
56
|
+
it { should keep(:Word, :P ).from(word) }
|
57
|
+
it { should keep(:Word, :S ).from(word) }
|
58
|
+
it { should keep(:Word, :Z ).from(word) }
|
59
|
+
it { should keep(:Word, :C ).from(word) }
|
60
|
+
it { should keep(:Latin, :L ).from(word) }
|
61
|
+
it { should keep(:Latin, :M ).from(word) }
|
62
|
+
it { should keep(:Latin, :N ).from(word) }
|
63
|
+
it { should keep(:Latin, :P ).from(word) }
|
64
|
+
it { should keep(:Latin, :S ).from(word) }
|
65
|
+
it { should keep(:Latin, :Z ).from(word) }
|
66
|
+
it { should keep(:Latin, :C ).from(word) }
|
67
|
+
it { should keep(:L, :M ).from(word) }
|
68
|
+
it { should keep(:L, :N ).from(word) }
|
69
|
+
it { should keep(:L, :P ).from(word) }
|
70
|
+
it { should keep(:L, :S ).from(word) }
|
71
|
+
it { should keep(:L, :Z ).from(word) }
|
72
|
+
it { should keep(:L, :C ).from(word) }
|
73
|
+
it { should keep(:M, :N ).from(word) }
|
74
|
+
it { should keep(:M, :P ).from(word) }
|
75
|
+
it { should keep(:M, :S ).from(word) }
|
76
|
+
it { should keep(:M, :Z ).from(word) }
|
77
|
+
it { should keep(:M, :C ).from(word) }
|
78
|
+
it { should keep(:N, :P ).from(word) }
|
79
|
+
it { should keep(:N, :S ).from(word) }
|
80
|
+
it { should keep(:N, :Z ).from(word) }
|
81
|
+
it { should keep(:N, :C ).from(word) }
|
82
|
+
it { should keep(:P, :S ).from(word) }
|
83
|
+
it { should keep(:P, :Z ).from(word) }
|
84
|
+
it { should keep(:P, :C ).from(word) }
|
85
|
+
it { should keep(:S, :Z ).from(word) }
|
86
|
+
it { should keep(:S, :C ).from(word) }
|
87
|
+
it { should keep(:Z, :C ).from(word) }
|
88
|
+
it { should evaluate(100 ).to(100 ) }
|
89
|
+
it { should evaluate(nil ).to(nil ) }
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -1,86 +1,92 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/remove_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe RemoveFilter do
|
8
|
+
let(:word) {"ᰄ긚 ᧔瑤л꽥๏ ѨDꨥ\aՇ謬ꗀᶆᵆ쳻ῼἬ鿃ႍꥈᤫ꙲⅟౮ⅰ⅘༌_゠⟦〉⸠›⸓⌟⅂₧௹¨⣭ \u2028\u2029\u008C\u0011\uA7E5" }
|
9
|
+
|
10
|
+
it { should remove(:Graph ).from(word) }
|
11
|
+
it { should remove(:Punct ).from(word) }
|
12
|
+
it { should remove(:Upper ).from(word) }
|
13
|
+
it { should remove(:Word ).from(word) }
|
14
|
+
it { should remove(:Latin ).from(word) }
|
15
|
+
it { should remove(:L ).from(word) }
|
16
|
+
it { should remove(:M ).from(word) }
|
17
|
+
it { should remove(:N ).from(word) }
|
18
|
+
it { should remove(:P ).from(word) }
|
19
|
+
it { should remove(:S ).from(word) }
|
20
|
+
it { should remove(:Z ).from(word) }
|
21
|
+
it { should remove(:C ).from(word) }
|
22
|
+
it { should remove(:Graph, :Punct).from(word) }
|
23
|
+
it { should remove(:Graph, :Upper).from(word) }
|
24
|
+
it { should remove(:Graph, :Word ).from(word) }
|
25
|
+
it { should remove(:Graph, :Latin).from(word) }
|
26
|
+
it { should remove(:Graph, :L ).from(word) }
|
27
|
+
it { should remove(:Graph, :M ).from(word) }
|
28
|
+
it { should remove(:Graph, :N ).from(word) }
|
29
|
+
it { should remove(:Graph, :P ).from(word) }
|
30
|
+
it { should remove(:Graph, :S ).from(word) }
|
31
|
+
it { should remove(:Graph, :Z ).from(word) }
|
32
|
+
it { should remove(:Graph, :C ).from(word) }
|
33
|
+
it { should remove(:Punct, :Upper).from(word) }
|
34
|
+
it { should remove(:Punct, :Word ).from(word) }
|
35
|
+
it { should remove(:Punct, :Latin).from(word) }
|
36
|
+
it { should remove(:Punct, :L ).from(word) }
|
37
|
+
it { should remove(:Punct, :M ).from(word) }
|
38
|
+
it { should remove(:Punct, :N ).from(word) }
|
39
|
+
it { should remove(:Punct, :P ).from(word) }
|
40
|
+
it { should remove(:Punct, :S ).from(word) }
|
41
|
+
it { should remove(:Punct, :Z ).from(word) }
|
42
|
+
it { should remove(:Punct, :C ).from(word) }
|
43
|
+
it { should remove(:Upper, :Word ).from(word) }
|
44
|
+
it { should remove(:Upper, :Latin).from(word) }
|
45
|
+
it { should remove(:Upper, :L ).from(word) }
|
46
|
+
it { should remove(:Upper, :M ).from(word) }
|
47
|
+
it { should remove(:Upper, :N ).from(word) }
|
48
|
+
it { should remove(:Upper, :P ).from(word) }
|
49
|
+
it { should remove(:Upper, :S ).from(word) }
|
50
|
+
it { should remove(:Upper, :Z ).from(word) }
|
51
|
+
it { should remove(:Upper, :C ).from(word) }
|
52
|
+
it { should remove(:Word, :Latin ).from(word) }
|
53
|
+
it { should remove(:Word, :L ).from(word) }
|
54
|
+
it { should remove(:Word, :M ).from(word) }
|
55
|
+
it { should remove(:Word, :N ).from(word) }
|
56
|
+
it { should remove(:Word, :P ).from(word) }
|
57
|
+
it { should remove(:Word, :S ).from(word) }
|
58
|
+
it { should remove(:Word, :Z ).from(word) }
|
59
|
+
it { should remove(:Word, :C ).from(word) }
|
60
|
+
it { should remove(:Latin, :L ).from(word) }
|
61
|
+
it { should remove(:Latin, :M ).from(word) }
|
62
|
+
it { should remove(:Latin, :N ).from(word) }
|
63
|
+
it { should remove(:Latin, :P ).from(word) }
|
64
|
+
it { should remove(:Latin, :S ).from(word) }
|
65
|
+
it { should remove(:Latin, :Z ).from(word) }
|
66
|
+
it { should remove(:Latin, :C ).from(word) }
|
67
|
+
it { should remove(:L, :M ).from(word) }
|
68
|
+
it { should remove(:L, :N ).from(word) }
|
69
|
+
it { should remove(:L, :P ).from(word) }
|
70
|
+
it { should remove(:L, :S ).from(word) }
|
71
|
+
it { should remove(:L, :Z ).from(word) }
|
72
|
+
it { should remove(:L, :C ).from(word) }
|
73
|
+
it { should remove(:M, :N ).from(word) }
|
74
|
+
it { should remove(:M, :P ).from(word) }
|
75
|
+
it { should remove(:M, :S ).from(word) }
|
76
|
+
it { should remove(:M, :Z ).from(word) }
|
77
|
+
it { should remove(:M, :C ).from(word) }
|
78
|
+
it { should remove(:N, :P ).from(word) }
|
79
|
+
it { should remove(:N, :S ).from(word) }
|
80
|
+
it { should remove(:N, :Z ).from(word) }
|
81
|
+
it { should remove(:N, :C ).from(word) }
|
82
|
+
it { should remove(:P, :S ).from(word) }
|
83
|
+
it { should remove(:P, :Z ).from(word) }
|
84
|
+
it { should remove(:P, :C ).from(word) }
|
85
|
+
it { should remove(:S, :Z ).from(word) }
|
86
|
+
it { should remove(:S, :C ).from(word) }
|
87
|
+
it { should remove(:Z, :C ).from(word) }
|
88
|
+
it { should evaluate(100 ).to(100 ) }
|
89
|
+
it { should evaluate(nil ).to(nil ) }
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -1,10 +1,14 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/squeeze_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe SqueezeFilter do
|
8
|
+
it { should evaluate("squeezing: hells bells").to("squezing: hels bels" ) }
|
9
|
+
it { should evaluate("squeezing: hells bells").to("squeezing: hels bels").with("l") }
|
10
|
+
it { should evaluate(100 ).to(100 ) }
|
11
|
+
it { should evaluate(nil ).to(nil ) }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,12 +1,16 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/squish_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe SquishFilter do
|
8
|
+
it { should evaluate(" Friday 05 October 2012 " ).to("Friday 05 October 2012") }
|
9
|
+
it { should evaluate("Friday 05 October 2012" ).to("Friday 05 October 2012") }
|
10
|
+
it { should evaluate("Friday \n05 \nOctober \n2012" ).to("Friday 05 October 2012") }
|
11
|
+
it { should evaluate(" Friday 05 \nOctober 2012 ").to("Friday 05 October 2012") }
|
12
|
+
it { should evaluate(100 ).to(100 ) }
|
13
|
+
it { should evaluate(nil ).to(nil ) }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,12 +1,16 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/strip_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe StripFilter do
|
8
|
+
it { should evaluate(" to anywhere ").to("to anywhere" ) }
|
9
|
+
it { should evaluate(" to anywhere ").to("to anywhere ").with(:L ) }
|
10
|
+
it { should evaluate(" to anywhere ").to(" to anywhere").with(:R ) }
|
11
|
+
it { should evaluate(" to anywhere ").to("to anywhere" ).with(:LR) }
|
12
|
+
it { should evaluate(100 ).to(100 ) }
|
13
|
+
it { should evaluate(nil ).to(nil ) }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,12 +1,16 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/swapcase_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe SwapcaseFilter do
|
8
|
+
it { should evaluate("caçador").to("CAÇADOR") }
|
9
|
+
it { should evaluate("CAÇADOR").to("caçador") }
|
10
|
+
it { should evaluate("CaÇaDoR").to("cAçAdOr") }
|
11
|
+
it { should evaluate("cAçAdOr").to("CaÇaDoR") }
|
12
|
+
it { should evaluate(100 ).to(100 ) }
|
13
|
+
it { should evaluate(nil ).to(nil ) }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,12 +1,16 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/titleize_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe TitleizeFilter do
|
8
|
+
it { should evaluate("04. until it sleeps" ).to("04. Until It Sleeps" ) }
|
9
|
+
it { should evaluate("04. UNTIL IT SLEEPS" ).to("04. Until It Sleeps" ) }
|
10
|
+
it { should evaluate("quem é o dono deste sofá?").to("Quem É O Dono Deste Sofá?") }
|
11
|
+
it { should evaluate("QUEM É O DONO DESTE SOFÁ?").to("Quem É O Dono Deste Sofá?") }
|
12
|
+
it { should evaluate(100 ).to(100 ) }
|
13
|
+
it { should evaluate(nil ).to(nil ) }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,26 +1,40 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/underscore_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe UnderscoreFilter do
|
8
|
+
it { should evaluate("AintNo::RestFor::TheWicked" ).to("aint_no/rest_for/the_wicked") }
|
9
|
+
it { should evaluate("Assets::Stocks::Companies" ).to("assets/stocks/companies" ) }
|
10
|
+
it { should evaluate("Bank::Account" ).to("bank/account" ) }
|
11
|
+
it { should evaluate("ForSale" ).to("for_sale" ) }
|
12
|
+
it { should evaluate("HighVoltage::Musics" ).to("high_voltage/musics" ) }
|
13
|
+
it { should evaluate("NoteBook::BlackPiano" ).to("note_book/black_piano" ) }
|
14
|
+
it { should evaluate("Product" ).to("product" ) }
|
15
|
+
it { should evaluate("SouthAmerica::Brazil::Paraná").to("south_america/brazil/paraná") }
|
16
|
+
it { should evaluate("YouCannot::StealMy::Wallet" ).to("you_cannot/steal_my/wallet" ) }
|
17
|
+
|
18
|
+
context "with acronyms setted" do
|
19
|
+
let(:inflections) { ActiveSupport::Inflector::Inflections.instance }
|
14
20
|
|
15
|
-
|
16
|
-
|
17
|
-
|
21
|
+
before(:all) do
|
22
|
+
inflections.acronym 'HTTP'
|
23
|
+
inflections.acronym 'SSL'
|
24
|
+
inflections.acronym 'Xml'
|
25
|
+
inflections.acronym 'docType'
|
26
|
+
end
|
18
27
|
|
19
|
-
|
20
|
-
|
21
|
-
|
28
|
+
after(:all) do
|
29
|
+
inflections.acronyms.delete("http")
|
30
|
+
inflections.acronyms.delete("ssl")
|
31
|
+
inflections.acronyms.delete("xml")
|
32
|
+
inflections.acronyms.delete("doctype")
|
33
|
+
end
|
22
34
|
|
23
|
-
|
24
|
-
|
35
|
+
it { should evaluate("HTTPAddress::SSLLib::XmlFile::docType").to("http_address/ssl_lib/xml_file/doctype") }
|
36
|
+
it { should evaluate("docTypeStop::RunSSL::Xml::MixHTTP" ).to("doctype_stop/run_ssl/xml/mix_http" ) }
|
37
|
+
end
|
38
|
+
end
|
25
39
|
end
|
26
|
-
end
|
40
|
+
end
|
@@ -1,10 +1,14 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'normatron/filters/upcase_filter'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
module Normatron
|
6
|
+
module Filters
|
7
|
+
describe UpcaseFilter do
|
8
|
+
it { should evaluate("caçador").to("CAÇADOR") }
|
9
|
+
it { should evaluate("CAÇADOR").to("CAÇADOR") }
|
10
|
+
it { should evaluate(100 ).to(100 ) }
|
11
|
+
it { should evaluate(nil ).to(nil ) }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
module FilterMatchers
|
2
|
+
def keep(*properties)
|
3
|
+
CharacterCleanerMatcher.new(*properties, :keep)
|
4
|
+
end
|
5
|
+
|
6
|
+
def remove(*properties)
|
7
|
+
CharacterCleanerMatcher.new(*properties, :remove)
|
8
|
+
end
|
9
|
+
|
10
|
+
class CharacterCleanerMatcher
|
11
|
+
def initialize(*properties, action)
|
12
|
+
@options = {}
|
13
|
+
@options[:properties] = properties
|
14
|
+
@options[:action] = action
|
15
|
+
self
|
16
|
+
end
|
17
|
+
|
18
|
+
def from(word)
|
19
|
+
@options[:input] = word
|
20
|
+
self
|
21
|
+
end
|
22
|
+
|
23
|
+
def matches?(subject)
|
24
|
+
@subject = subject
|
25
|
+
@expected = @options[:input].gsub(regexp, '')
|
26
|
+
@got = @subject.evaluate(@options[:input], @options[:properties])
|
27
|
+
@failure_reason = failure_reason
|
28
|
+
@failure_reason.nil?
|
29
|
+
end
|
30
|
+
|
31
|
+
def description
|
32
|
+
case @failure_reason
|
33
|
+
when :identity
|
34
|
+
"not be equal #{@expected.inspect}"
|
35
|
+
when :type
|
36
|
+
"be a kind of #{@options[:input].class}"
|
37
|
+
else
|
38
|
+
"#{@options[:action]} #{@options[:properties].inspect} from input value"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def failure_message
|
43
|
+
case @failure_reason
|
44
|
+
when :value
|
45
|
+
["input: #{@options[:input].inspect}",
|
46
|
+
"expected: #{@expected.inspect}",
|
47
|
+
"got: #{@got.inspect}"] * "\n"
|
48
|
+
when :identity
|
49
|
+
"expected #{@options[:filter].name} evaluate and returns a different object_id from input object."
|
50
|
+
when :type
|
51
|
+
"expected #{@options[:filter].name} evaluate and returns the same object type of his input."
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def failure_reason
|
58
|
+
if @got != @expected
|
59
|
+
:value
|
60
|
+
elsif !@got.kind_of?(@options[:input].class)
|
61
|
+
:type
|
62
|
+
elsif @got.equal?(@options[:input]) && @got.kind_of?(String)
|
63
|
+
:identity
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def regexp
|
68
|
+
construct = @options[:properties].map { |p| "\\p{#{p}}" } * ""
|
69
|
+
construct = "[#{'^' if @options[:action] == :keep}#{construct}]"
|
70
|
+
Regexp.new(construct.force_encoding "UTF-8")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -6,6 +6,7 @@ module FilterMatchers
|
|
6
6
|
class EvaluateMatcher
|
7
7
|
def initialize(input)
|
8
8
|
@input = input
|
9
|
+
@constraints = Hash[:value, true, :type, true, :identity, true]
|
9
10
|
self
|
10
11
|
end
|
11
12
|
|
@@ -19,6 +20,11 @@ module FilterMatchers
|
|
19
20
|
self
|
20
21
|
end
|
21
22
|
|
23
|
+
def constraints(constraint)
|
24
|
+
@constraints.merge! constraint
|
25
|
+
self
|
26
|
+
end
|
27
|
+
|
22
28
|
def matches?(filter_module)
|
23
29
|
@filter = filter_module
|
24
30
|
@got = get_evaluation
|
@@ -63,11 +69,11 @@ module FilterMatchers
|
|
63
69
|
end
|
64
70
|
|
65
71
|
def get_failure_reason
|
66
|
-
if @got != @expected
|
72
|
+
if @constraints[:value] && (@got != @expected)
|
67
73
|
:value
|
68
|
-
elsif !@got.kind_of?(@input.class)
|
74
|
+
elsif @constraints[:type] && !@got.kind_of?(@input.class)
|
69
75
|
:type
|
70
|
-
elsif @got.equal?(@input) && @got.kind_of?(String)
|
76
|
+
elsif @constraints[:identity] && @got.equal?(@input) && @got.kind_of?(String)
|
71
77
|
:identity
|
72
78
|
end
|
73
79
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: normatron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- .yardopts
|
134
134
|
- spec/spec_helper.rb
|
135
135
|
- spec/support/user_model.rb
|
136
|
+
- spec/support/matchers/character_cleaner_matcher.rb
|
136
137
|
- spec/support/matchers/evaluate_matcher.rb
|
137
138
|
- spec/support/my_filters.rb
|
138
139
|
- spec/normatron_spec.rb
|
@@ -182,6 +183,7 @@ summary: Normalize attributes for ActiveRecord objects.
|
|
182
183
|
test_files:
|
183
184
|
- spec/spec_helper.rb
|
184
185
|
- spec/support/user_model.rb
|
186
|
+
- spec/support/matchers/character_cleaner_matcher.rb
|
185
187
|
- spec/support/matchers/evaluate_matcher.rb
|
186
188
|
- spec/support/my_filters.rb
|
187
189
|
- spec/normatron_spec.rb
|