powerpack 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/powerpack/enumerable/frequencies.rb +1 -1
- data/lib/powerpack/version.rb +1 -1
- data/powerpack.gemspec +1 -1
- data/spec/powerpack/enumerable/exactly_spec.rb +8 -8
- data/spec/powerpack/enumerable/several_spec.rb +5 -5
- data/spec/powerpack/numeric/neg_spec.rb +6 -6
- data/spec/powerpack/numeric/pos_spec.rb +6 -6
- data/spec/powerpack/string/blank_spec.rb +3 -3
- data/spec/spec_helper.rb +0 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a3a66b83a0099f21936fdf18fdd2465ee803a0b
|
4
|
+
data.tar.gz: 850e52d270c66647b71ff8a98a44bcfca39c9e14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 076f54612a3f4c83715654f2c5ecd82792b492b4a52308b52f43f6a4d718334eed4f24f4f578c7ca4f9d04cfa11c1e141075bbafd2fe465b5a63123ae9287dac
|
7
|
+
data.tar.gz: 06746d79155d9a90500fbf93843e2b69aec72aca92b55389267b3f474dcc6127fd659a0bf108d0870d554c824948fb4785fe77f7074ad2a2ee8735d52b7e3606
|
data/CHANGELOG.md
CHANGED
data/lib/powerpack/version.rb
CHANGED
data/powerpack.gemspec
CHANGED
@@ -19,6 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
21
21
|
spec.add_development_dependency 'rake'
|
22
|
-
spec.add_development_dependency('rspec'
|
22
|
+
spec.add_development_dependency('rspec')
|
23
23
|
spec.add_development_dependency('yard', '~> 0.8')
|
24
24
|
end
|
@@ -3,37 +3,37 @@ require 'spec_helper'
|
|
3
3
|
describe 'Enumerable#exactly' do
|
4
4
|
context 'with block' do
|
5
5
|
it 'returns true for exact number of matches' do
|
6
|
-
expect([1, 2, 3, 4].exactly?(2, &:even?)).to
|
6
|
+
expect([1, 2, 3, 4].exactly?(2, &:even?)).to be_truthy
|
7
7
|
end
|
8
8
|
|
9
9
|
it 'returns false for less matches' do
|
10
|
-
expect([1, 3, 4].exactly?(2, &:even?)).to
|
10
|
+
expect([1, 3, 4].exactly?(2, &:even?)).to be_falsey
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'returns false for more matches' do
|
14
|
-
expect([1, 3, 4, 6, 8].exactly?(2, &:even?)).to
|
14
|
+
expect([1, 3, 4, 6, 8].exactly?(2, &:even?)).to be_falsey
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
context 'without block' do
|
19
19
|
it 'returns true for exact number of non nil/false elements in absence of nil/false elements' do
|
20
|
-
expect([1, 2, 3, 4].exactly?(4)).to
|
20
|
+
expect([1, 2, 3, 4].exactly?(4)).to be_truthy
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'returns true for exact number of non nil/false elements in presence of nil/false elements' do
|
24
|
-
expect([1, 2, nil, false].exactly?(2)).to
|
24
|
+
expect([1, 2, nil, false].exactly?(2)).to be_truthy
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'returns true for exact number of nil/false elements' do
|
28
|
-
expect([nil, false].exactly?(0)).to
|
28
|
+
expect([nil, false].exactly?(0)).to be_truthy
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'returns false if there are less non nil/false elements in absence of nil/false elements' do
|
32
|
-
expect([1, 2, 3].exactly?(4)).to
|
32
|
+
expect([1, 2, 3].exactly?(4)).to be_falsey
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'returns false if there are less non nil/false elements in presence of nil/false elements' do
|
36
|
-
expect([1, nil, false].exactly?(4)).to
|
36
|
+
expect([1, nil, false].exactly?(4)).to be_falsey
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -3,25 +3,25 @@ require 'spec_helper'
|
|
3
3
|
describe 'Enumerable#several' do
|
4
4
|
context 'with block' do
|
5
5
|
it 'returns true if more than 1 element matches the predicate' do
|
6
|
-
expect([1, 2, 3, 4].several?(&:even?)).to
|
6
|
+
expect([1, 2, 3, 4].several?(&:even?)).to be_truthy
|
7
7
|
end
|
8
8
|
|
9
9
|
it 'returns false if just 1 element matches the predicate' do
|
10
|
-
expect([1, 3, 4].several?(&:even?)).to
|
10
|
+
expect([1, 3, 4].several?(&:even?)).to be_falsey
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'returns false if no elements match the predicate' do
|
14
|
-
expect([1, 3, 4].several?(&:even?)).to
|
14
|
+
expect([1, 3, 4].several?(&:even?)).to be_falsey
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
context 'without block' do
|
19
19
|
it 'returns true if there are 2 or more non nil/false elements' do
|
20
|
-
expect([1, 2, 3, 4].several?).to
|
20
|
+
expect([1, 2, 3, 4].several?).to be_truthy
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'returns false if there are less than 2 non nil/false elements' do
|
24
|
-
expect([1, nil, false].several?).to
|
24
|
+
expect([1, nil, false].several?).to be_falsey
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -2,23 +2,23 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'Numeric#neg?' do
|
4
4
|
it 'returns false for positive integer' do
|
5
|
-
expect(1.neg?).to
|
5
|
+
expect(1.neg?).to be_falsey
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'returns false for positive float' do
|
9
|
-
expect(0.1.neg?).to
|
9
|
+
expect(0.1.neg?).to be_falsey
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'returns true for negative integer' do
|
13
|
-
expect(-1.neg?).to
|
13
|
+
expect(-1.neg?).to be_truthy
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'returns true for negative float' do
|
17
|
-
expect(-0.01.neg?).to
|
17
|
+
expect(-0.01.neg?).to be_truthy
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'returns false for 0' do
|
21
|
-
expect(0.neg?).to
|
22
|
-
expect(0.0.neg?).to
|
21
|
+
expect(0.neg?).to be_falsey
|
22
|
+
expect(0.0.neg?).to be_falsey
|
23
23
|
end
|
24
24
|
end
|
@@ -2,23 +2,23 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'Numeric#pos?' do
|
4
4
|
it 'returns true for positive integer' do
|
5
|
-
expect(1.pos?).to
|
5
|
+
expect(1.pos?).to be_truthy
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'returns true for positive float' do
|
9
|
-
expect(0.1.pos?).to
|
9
|
+
expect(0.1.pos?).to be_truthy
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'returns false for negative integer' do
|
13
|
-
expect(-1.pos?).to
|
13
|
+
expect(-1.pos?).to be_falsey
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'returns false for negative float' do
|
17
|
-
expect(-0.01.pos?).to
|
17
|
+
expect(-0.01.pos?).to be_falsey
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'returns false for 0' do
|
21
|
-
expect(0.pos?).to
|
22
|
-
expect(0.0.pos?).to
|
21
|
+
expect(0.pos?).to be_falsey
|
22
|
+
expect(0.0.pos?).to be_falsey
|
23
23
|
end
|
24
24
|
end
|
@@ -2,14 +2,14 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'String#blank?' do
|
4
4
|
it 'returns true for an empty string' do
|
5
|
-
expect(''.blank?).to
|
5
|
+
expect(''.blank?).to be_truthy
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'returns true for a string with only whitespace in it' do
|
9
|
-
expect(' '.blank?).to
|
9
|
+
expect(' '.blank?).to be_truthy
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'returns false for a string with non-whitespace chars in it' do
|
13
|
-
expect(' test'.blank?).to
|
13
|
+
expect(' test'.blank?).to be_falsey
|
14
14
|
end
|
15
15
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: powerpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: yard
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|