lazier 3.5.0 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -187,10 +187,10 @@ describe Lazier::Object do
187
187
  end
188
188
 
189
189
  it "should grant access" do
190
- reference = {a: "b"}
190
+ subject = {a: "b"}
191
191
 
192
- expect(reference).to receive(:ensure_access).with("ACCESS")
193
- reference.ensure_hash("ACCESS")
192
+ expect(subject ).to receive(:ensure_access).with("ACCESS")
193
+ subject .ensure_hash("ACCESS")
194
194
  end
195
195
  end
196
196
 
@@ -329,10 +329,10 @@ describe Lazier::Object do
329
329
 
330
330
  describe "#for_debug" do
331
331
  it "should return the correct representation for an object" do
332
- reference = {a: "b"}
333
- expect(reference.for_debug(:json, false)).to eq(reference.to_json)
334
- expect(reference.for_debug(:pretty_json, false)).to eq(::JSON.pretty_generate(reference))
335
- expect(reference.for_debug(:yaml, false)).to eq(reference.to_yaml)
332
+ subject = {a: "b"}
333
+ expect(subject.for_debug(:json, false)).to eq(subject .to_json)
334
+ expect(subject.for_debug(:pretty_json, false)).to eq(::JSON.pretty_generate(subject ))
335
+ expect(subject.for_debug(:yaml, false)).to eq(subject .to_yaml)
336
336
  end
337
337
 
338
338
  it "should raise an exception if requested" do
@@ -7,7 +7,7 @@
7
7
  require "spec_helper"
8
8
 
9
9
  describe Lazier::Pathname do
10
- let(:reference) { ::Pathname.new($0) }
10
+ subject { ::Pathname.new($0) }
11
11
 
12
12
  before(:all) do
13
13
  ::Lazier.load!
@@ -15,7 +15,7 @@ describe Lazier::Pathname do
15
15
 
16
16
  describe "#components" do
17
17
  it "should return the components of the path" do
18
- expect([""] + reference.components).to eq(reference.to_s.split("/"))
18
+ expect([""] + subject.components).to eq(subject.to_s.split("/"))
19
19
  end
20
20
  end
21
21
  end
@@ -7,9 +7,9 @@
7
7
  require "spec_helper"
8
8
 
9
9
  describe Lazier::Settings do
10
- let(:reference) { ::Lazier::Settings.instance }
11
- let(:number_reference) { 123456.654321 }
12
- let(:date_reference) { DateTime.civil(2005, 6, 7, 8, 9, 10, DateTime.rationalize_offset(25200)) }
10
+ let(:subject) { ::Lazier::Settings.instance }
11
+ let(:number_subject) { 123456.654321 }
12
+ let(:date_subject) { DateTime.civil(2005, 6, 7, 8, 9, 10, DateTime.rationalize_offset(25200)) }
13
13
 
14
14
  before(:all) do
15
15
  Lazier.load!
@@ -45,86 +45,86 @@ describe Lazier::Settings do
45
45
 
46
46
  describe "#setup_format_number" do
47
47
  it "should save format numbering options for usage" do
48
- reference.setup_format_number(2)
49
- expect(number_reference.format_number).to eq("123,456.65")
48
+ subject.setup_format_number(2)
49
+ expect(number_subject.format_number).to eq("123,456.65")
50
50
 
51
- reference.setup_format_number(3, "A")
52
- expect(number_reference.format_number).to eq("123,456A654")
51
+ subject.setup_format_number(3, "A")
52
+ expect(number_subject.format_number).to eq("123,456A654")
53
53
 
54
- reference.setup_format_number(4, "A", "B")
55
- expect(number_reference.format_number).to eq("123,456A6543 B")
54
+ subject.setup_format_number(4, "A", "B")
55
+ expect(number_subject.format_number).to eq("123,456A6543 B")
56
56
 
57
- reference.setup_format_number(5, "A", "B", "C")
58
- expect(number_reference.format_number).to eq("123C456A65432 B")
57
+ subject.setup_format_number(5, "A", "B", "C")
58
+ expect(number_subject.format_number).to eq("123C456A65432 B")
59
59
 
60
- reference.setup_format_number
61
- expect(number_reference.format_number).to eq("123,456.65")
60
+ subject.setup_format_number
61
+ expect(number_subject.format_number).to eq("123,456.65")
62
62
  end
63
63
  end
64
64
 
65
65
  describe "#setup_boolean_names" do
66
66
  it "should save names for boolean values" do
67
- reference.setup_boolean_names("TRUE1")
67
+ subject.setup_boolean_names("TRUE1")
68
68
  expect([true.format_boolean, false.format_boolean]).to eq(["TRUE1", "No"])
69
69
 
70
- reference.setup_boolean_names(nil, "FALSE1")
70
+ subject.setup_boolean_names(nil, "FALSE1")
71
71
  expect([true.format_boolean, false.format_boolean]).to eq(["Yes", "FALSE1"])
72
72
 
73
- reference.setup_boolean_names("TRUE2", "FALSE2")
73
+ subject.setup_boolean_names("TRUE2", "FALSE2")
74
74
  expect([true.format_boolean, false.format_boolean]).to eq(["TRUE2", "FALSE2"])
75
75
 
76
- reference.setup_boolean_names
76
+ subject.setup_boolean_names
77
77
  expect([true.format_boolean, false.format_boolean]).to eq(["Yes", "No"])
78
78
  end
79
79
  end
80
80
 
81
81
  describe "#setup_date_formats" do
82
82
  it "should save formats for date formatting" do
83
- reference.setup_date_formats(nil, true)
83
+ subject.setup_date_formats(nil, true)
84
84
 
85
- reference.setup_date_formats({c1: "%Y"})
86
- expect(date_reference.lstrftime(:ct_date)).to eq(date_reference.strftime("%Y-%m-%d"))
87
- expect(date_reference.lstrftime("c1")).to eq(date_reference.year.to_s)
85
+ subject.setup_date_formats({c1: "%Y"})
86
+ expect(date_subject.lstrftime(:ct_date)).to eq(date_subject.strftime("%Y-%m-%d"))
87
+ expect(date_subject.lstrftime("c1")).to eq(date_subject.year.to_s)
88
88
 
89
- reference.setup_date_formats({c1: "%Y"}, true)
90
- expect(date_reference.lstrftime("ct_date")).to eq("ct_date")
91
- expect(date_reference.lstrftime(:c1)).to eq(date_reference.year.to_s)
89
+ subject.setup_date_formats({c1: "%Y"}, true)
90
+ expect(date_subject.lstrftime("ct_date")).to eq("ct_date")
91
+ expect(date_subject.lstrftime(:c1)).to eq(date_subject.year.to_s)
92
92
 
93
- reference.setup_date_formats
94
- expect(date_reference.lstrftime(:ct_date)).to eq(date_reference.strftime("%Y-%m-%d"))
95
- expect(date_reference.lstrftime("c1")).to eq(date_reference.year.to_s)
93
+ subject.setup_date_formats
94
+ expect(date_subject.lstrftime(:ct_date)).to eq(date_subject.strftime("%Y-%m-%d"))
95
+ expect(date_subject.lstrftime("c1")).to eq(date_subject.year.to_s)
96
96
 
97
- reference.setup_date_formats(nil, true)
98
- expect(date_reference.lstrftime("ct_date")).to eq(date_reference.strftime("%Y-%m-%d"))
99
- expect(date_reference.lstrftime(:c1)).to eq("c1")
97
+ subject.setup_date_formats(nil, true)
98
+ expect(date_subject.lstrftime("ct_date")).to eq(date_subject.strftime("%Y-%m-%d"))
99
+ expect(date_subject.lstrftime(:c1)).to eq("c1")
100
100
  end
101
101
  end
102
102
 
103
103
  describe "#setup_date_names" do
104
104
  it "should save names for days and months" do
105
- reference.i18n = :en
106
- reference.setup_date_names
107
- reference.setup_date_formats({sdn: "%B %b %A %a"})
105
+ subject.i18n = :en
106
+ subject.setup_date_names
107
+ subject.setup_date_formats({sdn: "%B %b %A %a"})
108
108
 
109
109
  long_months = 12.times.map {|i| (i + 1).to_s * 2}
110
110
  short_months = 12.times.map {|i| (i + 1).to_s}
111
111
  long_days = 7.times.map {|i| (i + 1).to_s * 2}
112
112
  short_days = 7.times.map {|i| (i + 1).to_s}
113
113
 
114
- reference.setup_date_names(long_months)
115
- expect(date_reference.lstrftime(:sdn)).to eq("66 Jun Tuesday Tue")
114
+ subject.setup_date_names(long_months)
115
+ expect(date_subject.lstrftime(:sdn)).to eq("66 Jun Tuesday Tue")
116
116
 
117
- reference.setup_date_names(long_months, short_months)
118
- expect(date_reference.lstrftime("sdn")).to eq("66 6 Tuesday Tue")
117
+ subject.setup_date_names(long_months, short_months)
118
+ expect(date_subject.lstrftime("sdn")).to eq("66 6 Tuesday Tue")
119
119
 
120
- reference.setup_date_names(long_months, short_months, long_days)
121
- expect(date_reference.lstrftime(:sdn)).to eq("66 6 33 Tue")
120
+ subject.setup_date_names(long_months, short_months, long_days)
121
+ expect(date_subject.lstrftime(:sdn)).to eq("66 6 33 Tue")
122
122
 
123
- reference.setup_date_names(long_months, short_months, long_days, short_days)
124
- expect(date_reference.lstrftime("sdn")).to eq("66 6 33 3")
123
+ subject.setup_date_names(long_months, short_months, long_days, short_days)
124
+ expect(date_subject.lstrftime("sdn")).to eq("66 6 33 3")
125
125
 
126
- reference.setup_date_names
127
- expect(date_reference.lstrftime(:sdn)).to eq("June Jun Tuesday Tue")
126
+ subject.setup_date_names
127
+ expect(date_subject.lstrftime(:sdn)).to eq("June Jun Tuesday Tue")
128
128
  end
129
129
  end
130
130
  end
@@ -7,10 +7,10 @@
7
7
  require "spec_helper"
8
8
 
9
9
  describe Lazier::String do
10
- let(:reference) { "abc òùà èé >" }
11
- let(:translated_reference) { "abc oua ee >" }
12
- let(:untitleized_reference) { "abc-òùà-èé->" }
13
- let(:amp_reference) { "abc òùà èé >" }
10
+ subject { "abc òùà èé >" }
11
+ let(:translated_subject) { "abc oua ee >" }
12
+ let(:untitleized_subject) { "abc-òùà-èé->" }
13
+ let(:amp_subject) { "abc òùà èé >" }
14
14
 
15
15
  before(:all) do
16
16
  ::Lazier.load!
@@ -18,7 +18,7 @@ describe Lazier::String do
18
18
 
19
19
  describe "#remove_accents" do
20
20
  it "should translate accents" do
21
- expect(reference.remove_accents).to eq(translated_reference)
21
+ expect(subject.remove_accents).to eq(translated_subject)
22
22
  end
23
23
  end
24
24
 
@@ -38,22 +38,22 @@ describe Lazier::String do
38
38
 
39
39
  describe "#untitleize" do
40
40
  it "should convert spaces to dashes" do
41
- expect(reference.untitleize).to eq(untitleized_reference)
41
+ expect(subject.untitleize).to eq(untitleized_subject)
42
42
  end
43
43
  end
44
44
 
45
45
  describe "#replace_ampersands" do
46
46
  it "should remove HTML ampersands" do
47
- expect(reference.replace_ampersands).to eq(amp_reference)
47
+ expect(subject.replace_ampersands).to eq(amp_subject)
48
48
  end
49
49
  end
50
50
 
51
51
  describe "#value" do
52
52
  it "should return the string itself" do
53
- expect(reference.value).to eq(reference)
54
- expect(translated_reference.value).to eq(translated_reference)
55
- expect(untitleized_reference.value).to eq(untitleized_reference)
56
- expect(amp_reference.value).to eq(amp_reference)
53
+ expect(subject.value).to eq(subject)
54
+ expect(translated_subject.value).to eq(translated_subject)
55
+ expect(untitleized_subject.value).to eq(untitleized_subject)
56
+ expect(amp_subject.value).to eq(amp_subject)
57
57
  end
58
58
  end
59
59
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazier
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shogun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-16 00:00:00.000000000 Z
11
+ date: 2014-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -87,6 +87,7 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".DS_Store"
90
91
  - ".gitignore"
91
92
  - ".travis-gemfile"
92
93
  - ".travis.yml"
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
181
  version: '0'
181
182
  requirements: []
182
183
  rubyforge_project: lazier
183
- rubygems_version: 2.2.0
184
+ rubygems_version: 2.2.2
184
185
  signing_key:
185
186
  specification_version: 4
186
187
  summary: Several Ruby object enhancements.