paranoid_starlight 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
data/paranoid_starlight.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
|
|
23
23
|
gem.add_dependency("activemodel", ["~> 3.2"])
|
24
24
|
gem.add_dependency("twitter_cldr", ["~> 2.0"])
|
25
25
|
gem.add_dependency("fast_gettext", ["~> 0.6"])
|
26
|
-
|
26
|
+
#gem.add_dependency("activerecord", ["~> 3.2"])
|
27
27
|
gem.add_development_dependency("rspec")
|
28
28
|
gem.required_ruby_version = '>= 1.9.2'
|
29
29
|
end
|
@@ -6,8 +6,9 @@ require 'rspec'
|
|
6
6
|
|
7
7
|
class Fangirl
|
8
8
|
include ::ParanoidStarlight::Converters
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :telephone
|
10
10
|
attr_accessor :text
|
11
|
+
attr_accessor :basic_field, :basic_field_out
|
11
12
|
end
|
12
13
|
|
13
14
|
describe ParanoidStarlight::Converters do
|
@@ -56,26 +57,47 @@ describe ParanoidStarlight::Converters do
|
|
56
57
|
|
57
58
|
end
|
58
59
|
|
59
|
-
describe '
|
60
|
-
before
|
61
|
-
FastGettext.locale = 'sk'
|
60
|
+
describe 'template of converter' do
|
61
|
+
before do
|
62
62
|
@test = Fangirl.new
|
63
|
-
@test.
|
63
|
+
@test.basic_field = "Hello world!"
|
64
|
+
|
65
|
+
def @test.upcase(input, output = '')
|
66
|
+
basic_converter(self, input, output) do |text|
|
67
|
+
text.upcase
|
68
|
+
end
|
69
|
+
end
|
64
70
|
end
|
65
71
|
|
66
|
-
context '
|
67
|
-
it 'should
|
68
|
-
@test.
|
69
|
-
@test.
|
72
|
+
context 'had one attribute supplied' do
|
73
|
+
it 'should overwrite attribute' do
|
74
|
+
@test.upcase(:basic_field)
|
75
|
+
@test.basic_field.should == "HELLO WORLD!"
|
70
76
|
end
|
71
77
|
end
|
72
78
|
|
73
|
-
context '
|
74
|
-
it 'should
|
75
|
-
@test.
|
76
|
-
@test.
|
79
|
+
context 'had two attributes supplied' do
|
80
|
+
it 'should put result to second attribute' do
|
81
|
+
@test.upcase(:basic_field, :basic_field_out)
|
82
|
+
@test.basic_field.should == "Hello world!"
|
83
|
+
@test.basic_field_out.should == "HELLO WORLD!"
|
77
84
|
end
|
78
85
|
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
describe 'convert_telephone_number (for attributes)' do
|
91
|
+
before :each do
|
92
|
+
FastGettext.locale = 'sk'
|
93
|
+
@test = Fangirl.new
|
94
|
+
@test.telephone = '+421 123 456 789'
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'should convert telephone number into international format' do
|
98
|
+
@test.convert_telephone_number(:telephone)
|
99
|
+
@test.telephone.should == '421123456789'
|
100
|
+
end
|
79
101
|
end
|
80
102
|
|
81
103
|
describe 'clean_text (for attributes)' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paranoid_starlight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- LICENSE.txt
|
88
88
|
- README.md
|
89
89
|
- lib/paranoid_starlight.rb
|
90
|
+
- lib/paranoid_starlight/active_record.rb
|
90
91
|
- lib/paranoid_starlight/version.rb
|
91
92
|
- paranoid_starlight.gemspec
|
92
93
|
- specs/paranoid_starlight_spec.rb
|