zxcvbn-ruby 0.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,16 +15,16 @@ describe Zxcvbn::Matchers::Date do
15
15
  let(:matches) { matcher.matches(password) }
16
16
 
17
17
  it 'finds matches' do
18
- matches.should_not be_empty
18
+ expect(matches).not_to be_empty
19
19
  end
20
20
 
21
21
  it 'finds the correct matches' do
22
- matches.count.should eq 1
23
- matches[0].token.should eq %w[ 02 12 1997 ].join(separator)
24
- matches[0].separator.should eq separator
25
- matches[0].day.should eq 2
26
- matches[0].month.should eq 12
27
- matches[0].year.should eq 1997
22
+ expect(matches.count).to eq 1
23
+ expect(matches[0].token).to eq %w[ 02 12 1997 ].join(separator)
24
+ expect(matches[0].separator).to eq separator
25
+ expect(matches[0].day).to eq 2
26
+ expect(matches[0].month).to eq 12
27
+ expect(matches[0].year).to eq 1997
28
28
  end
29
29
  end
30
30
  end
@@ -103,7 +103,7 @@ describe Zxcvbn::Matchers::Date do
103
103
  let(:matches) { matcher.matches('testing0.x.1997') }
104
104
 
105
105
  it 'doesnt match' do
106
- matches.should be_empty
106
+ expect(matches).to be_empty
107
107
  end
108
108
  end
109
109
  end
@@ -1,19 +1,30 @@
1
- require 'spec_helper'
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
2
4
 
3
5
  describe Zxcvbn::Matchers::Dictionary do
4
- let(:matcher) { described_class.new('english', dictionary) }
5
- let(:dictionary) { Zxcvbn::Data.new.ranked_dictionaries['english'] }
6
+ subject(:matcher) { described_class.new("Test dictionary", dictionary) }
6
7
 
7
- it 'finds all the matches' do
8
- matches = matcher.matches('whatisinit')
9
- matches.count.should == 14
10
- expected_matches = ['wha', 'what', 'ha', 'hat', 'a', 'at', 'tis', 'i', 'is',
11
- 'sin', 'i', 'in', 'i', 'it']
12
- matches.map(&:matched_word).should == expected_matches
13
- end
8
+ describe "#matches" do
9
+ let(:matches) { matcher.matches(password) }
10
+ let(:matched_words) { matches.map(&:matched_word) }
11
+
12
+ context "Given a dictionary of English words" do
13
+ let(:dictionary) { Zxcvbn::Data.new.ranked_dictionaries["english"] }
14
+ let(:password) { "whatisinit" }
15
+
16
+ it "finds all the matches" do
17
+ expect(matched_words).to match_array %w[wha what ha hat a at tis i is sin i in i it]
18
+ end
19
+ end
20
+
21
+ context "Given a custom dictionary" do
22
+ let(:dictionary) { Zxcvbn::DictionaryRanker.rank_dictionary(%w[test AB10CD]) }
23
+ let(:password) { "AB10CD" }
14
24
 
15
- it 'matches uppercase' do
16
- matcher = described_class.new('user_inputs', Zxcvbn::DictionaryRanker.rank_dictionary(['test','AB10CD']))
17
- matcher.matches('AB10CD').should_not be_empty
25
+ it "matches uppercase passwords with normalised dictionary entries" do
26
+ expect(matched_words).to match_array(%w[ab10cd])
27
+ end
28
+ end
18
29
  end
19
- end
30
+ end
@@ -5,11 +5,11 @@ describe Zxcvbn::Matchers::Digits do
5
5
  let(:matches) { matcher.matches('testing1239xx9712') }
6
6
 
7
7
  it 'sets the pattern name' do
8
- matches.all? { |m| m.pattern == 'digits' }.should eql(true)
8
+ expect(matches.all? { |m| m.pattern == 'digits' }).to eql(true)
9
9
  end
10
10
 
11
11
  it 'finds the correct matches' do
12
- matches.count.should == 2
13
- matches[0].token.should eq '1239'
12
+ expect(matches.count).to eq(2)
13
+ expect(matches[0].token).to eq '1239'
14
14
  end
15
15
  end
@@ -7,7 +7,7 @@ describe Zxcvbn::Matchers::L33t do
7
7
 
8
8
  describe '#relevant_l33t_substitutions' do
9
9
  it 'returns relevant l33t substitutions' do
10
- matcher.relevent_l33t_subtable('p@ssw1rd24').should eq(
10
+ expect(matcher.relevent_l33t_subtable('p@ssw1rd24')).to eq(
11
11
  {'a' => ['4', '@'], 'i' => ['1'], 'l' => ['1'], 'z' => ['2']}
12
12
  )
13
13
  end
@@ -17,14 +17,14 @@ describe Zxcvbn::Matchers::L33t do
17
17
  context 'with 2 possible substitutions' do
18
18
  it 'returns the correct possible substitutions' do
19
19
  substitutions = {'a' => ['@'], 'i' => ['1']}
20
- matcher.l33t_subs(substitutions).should match_array([
20
+ expect(matcher.l33t_subs(substitutions)).to match_array([
21
21
  {'@' => 'a', '1' => 'i'}
22
22
  ])
23
23
  end
24
24
 
25
25
  it 'returns the correct possible substitutions with multiple options' do
26
26
  substitutions = {'a' => ['@', '4'], 'i' => ['1']}
27
- matcher.l33t_subs(substitutions).should match_array([
27
+ expect(matcher.l33t_subs(substitutions)).to match_array([
28
28
  {'@' => 'a', '1' => 'i'},
29
29
  {'4' => 'a', '1' => 'i'}
30
30
  ])
@@ -34,7 +34,7 @@ describe Zxcvbn::Matchers::L33t do
34
34
  context 'with 3 possible substitutions' do
35
35
  it 'returns the correct possible substitutions' do
36
36
  substitutions = {'a' => ['@'], 'i' => ['1'], 'z' => ['3']}
37
- matcher.l33t_subs(substitutions).should match_array([
37
+ expect(matcher.l33t_subs(substitutions)).to match_array([
38
38
  {'@' => 'a', '1' => 'i', '3' => 'z'}
39
39
  ])
40
40
  end
@@ -43,7 +43,7 @@ describe Zxcvbn::Matchers::L33t do
43
43
  context 'with 4 possible substitutions' do
44
44
  it 'returns the correct possible substitutions' do
45
45
  substitutions = {'a' => ['@'], 'i' => ['1'], 'z' => ['3'], 'b' => ['8']}
46
- matcher.l33t_subs(substitutions).should match_array([
46
+ expect(matcher.l33t_subs(substitutions)).to match_array([
47
47
  {'@' => 'a', '1' => 'i', '3' => 'z', '8' => 'b'}
48
48
  ])
49
49
  end
@@ -51,12 +51,14 @@ describe Zxcvbn::Matchers::L33t do
51
51
  end
52
52
 
53
53
  describe '#matches' do
54
- let(:matches) { matcher.matches('p@ssword') }
55
- # it doesn't match on 'password' because that's not in the english
56
- # dictionary/frequency list
54
+ subject(:matches) { matcher.matches('p@ssword') }
55
+
56
+ it "doesn't find 'password' because it's not in english.txt" do
57
+ expect(matches.map(&:matched_word)).not_to include "password"
58
+ end
57
59
 
58
60
  it 'finds the correct matches' do
59
- matches.map(&:matched_word).should eq([
61
+ expect(matches.map(&:matched_word)).to match_array([
60
62
  'pas',
61
63
  'a',
62
64
  'as',
@@ -65,7 +67,7 @@ describe Zxcvbn::Matchers::L33t do
65
67
  end
66
68
 
67
69
  it 'sets the token correctly on those matches' do
68
- matches.map(&:token).should eq([
70
+ expect(matches.map(&:token)).to match_array([
69
71
  'p@s',
70
72
  '@',
71
73
  '@s',
@@ -74,7 +76,7 @@ describe Zxcvbn::Matchers::L33t do
74
76
  end
75
77
 
76
78
  it 'sets the substituions used' do
77
- matches.map(&:sub).should eq([
79
+ expect(matches.map(&:sub)).to match_array([
78
80
  {'@' => 'a'},
79
81
  {'@' => 'a'},
80
82
  {'@' => 'a'},
@@ -82,4 +84,4 @@ describe Zxcvbn::Matchers::L33t do
82
84
  ])
83
85
  end
84
86
  end
85
- end
87
+ end
@@ -5,14 +5,14 @@ describe Zxcvbn::Matchers::Repeat do
5
5
  let(:matches) { matcher.matches('bbbbbtestingaaa') }
6
6
 
7
7
  it 'sets the pattern name' do
8
- matches.all? { |m| m.pattern == 'repeat' }.should eql(true)
8
+ expect(matches.all? { |m| m.pattern == 'repeat' }).to eql(true)
9
9
  end
10
10
 
11
11
  it 'finds the repeated patterns' do
12
- matches.count.should eq 2
13
- matches[0].token.should eq 'bbbbb'
14
- matches[0].repeated_char.should eq 'b'
15
- matches[1].token.should eq 'aaa'
16
- matches[1].repeated_char.should eq 'a'
12
+ expect(matches.count).to eq 2
13
+ expect(matches[0].token).to eq 'bbbbb'
14
+ expect(matches[0].repeated_char).to eq 'b'
15
+ expect(matches[1].token).to eq 'aaa'
16
+ expect(matches[1].repeated_char).to eq 'a'
17
17
  end
18
18
  end
@@ -5,17 +5,17 @@ describe Zxcvbn::Matchers::Sequences do
5
5
  let(:matches) { matcher.matches('abcde87654') }
6
6
 
7
7
  it 'sets the pattern name' do
8
- matches.all? { |m| m.pattern == 'sequence' }.should eql(true)
8
+ expect(matches.all? { |m| m.pattern == 'sequence' }).to eql(true)
9
9
  end
10
10
 
11
11
  it 'finds the correct matches' do
12
- matches.count.should == 2
13
- matches[0].token.should eq 'abcde'
14
- matches[1].token.should eq '87654'
12
+ expect(matches.count).to eq(2)
13
+ expect(matches[0].token).to eq 'abcde'
14
+ expect(matches[1].token).to eq '87654'
15
15
  end
16
16
 
17
17
  it 'finds overlapping matches' do
18
18
  matches = matcher.matches('abcba')
19
- matches.map(&:token).should eq ['abc', 'cba']
19
+ expect(matches.map(&:token)).to eq ['abc', 'cba']
20
20
  end
21
21
  end
@@ -8,13 +8,13 @@ describe Zxcvbn::Matchers::Spatial do
8
8
  let(:matches) { matcher.matches('rtyikm') }
9
9
 
10
10
  it 'finds the correct of matches' do
11
- matches.count.should eq 3
12
- matches[0].token.should eq 'rty'
13
- matches[0].graph.should eq 'qwerty'
14
- matches[1].token.should eq 'ikm'
15
- matches[1].graph.should eq 'qwerty'
16
- matches[2].token.should eq 'yik'
17
- matches[2].graph.should eq 'dvorak'
11
+ expect(matches.count).to eq 3
12
+ expect(matches[0].token).to eq 'rty'
13
+ expect(matches[0].graph).to eq 'qwerty'
14
+ expect(matches[1].token).to eq 'ikm'
15
+ expect(matches[1].graph).to eq 'qwerty'
16
+ expect(matches[2].token).to eq 'yik'
17
+ expect(matches[2].graph).to eq 'dvorak'
18
18
  end
19
19
  end
20
20
  end
@@ -5,11 +5,11 @@ describe Zxcvbn::Matchers::Year do
5
5
  let(:matches) { matcher.matches('testing1998') }
6
6
 
7
7
  it 'sets the pattern name' do
8
- matches.all? { |m| m.pattern == 'year' }.should eql(true)
8
+ expect(matches.all? { |m| m.pattern == 'year' }).to eql(true)
9
9
  end
10
10
 
11
11
  it 'finds the correct matches' do
12
- matches.count.should == 1
13
- matches[0].token.should eq '1998'
12
+ expect(matches.count).to eq(1)
13
+ expect(matches[0].token).to eq '1998'
14
14
  end
15
15
  end
@@ -18,7 +18,7 @@ describe Zxcvbn::Omnimatch do
18
18
  js_results = js_omnimatch(password)
19
19
  ruby_results = omnimatch(password)
20
20
 
21
- ruby_results.should match_js_results js_results
21
+ expect(ruby_results).to match_js_results js_results
22
22
  end
23
23
  end
24
24
  end
@@ -5,38 +5,38 @@ describe Zxcvbn::CrackTime do
5
5
 
6
6
  describe '#entropy_to_crack_time' do
7
7
  specify do
8
- entropy_to_crack_time(15.433976574415976).should eq 2.2134000000000014
8
+ expect(entropy_to_crack_time(15.433976574415976)).to eq 2.2134000000000014
9
9
  end
10
10
  end
11
11
 
12
12
  describe '#crack_time_to_score' do
13
13
  context 'crack time less than 10 to the power 2' do
14
14
  it 'returns 0' do
15
- crack_time_to_score(90).should eq 0
15
+ expect(crack_time_to_score(90)).to eq 0
16
16
  end
17
17
  end
18
18
 
19
19
  context 'crack time in between 10**2 and 10**4' do
20
20
  it 'returns 1' do
21
- crack_time_to_score(5000).should eq 1
21
+ expect(crack_time_to_score(5000)).to eq 1
22
22
  end
23
23
  end
24
24
 
25
25
  context 'crack time in between 10**4 and 10**6' do
26
26
  it 'returns 2' do
27
- crack_time_to_score(500_000).should eq 2
27
+ expect(crack_time_to_score(500_000)).to eq 2
28
28
  end
29
29
  end
30
30
 
31
31
  context 'crack time in between 10**6 and 10**8' do
32
32
  it 'returns 3' do
33
- crack_time_to_score(50_000_000).should eq 3
33
+ expect(crack_time_to_score(50_000_000)).to eq 3
34
34
  end
35
35
  end
36
36
 
37
37
  context 'crack time above 10**8' do
38
38
  it 'returns 4' do
39
- crack_time_to_score(110_000_000).should eq 4
39
+ expect(crack_time_to_score(110_000_000)).to eq 4
40
40
  end
41
41
  end
42
42
  end
@@ -52,7 +52,7 @@ describe Zxcvbn::CrackTime do
52
52
  context 'when less than a minute' do
53
53
  it 'should return instant' do
54
54
  [0, minute_to_seconds - 1].each do |seconds|
55
- display_time(seconds).should eql 'instant'
55
+ expect(display_time(seconds)).to eql 'instant'
56
56
  end
57
57
  end
58
58
  end
@@ -60,7 +60,7 @@ describe Zxcvbn::CrackTime do
60
60
  context 'when less than an hour' do
61
61
  it 'should return a readable time in minutes' do
62
62
  [60, (hour_to_seconds - 1)].each do |seconds|
63
- display_time(seconds).should =~ /[0-9]+ minutes$/
63
+ expect(display_time(seconds)).to match(/[0-9]+ minutes$/)
64
64
  end
65
65
  end
66
66
  end
@@ -68,7 +68,7 @@ describe Zxcvbn::CrackTime do
68
68
  context 'when less than a day' do
69
69
  it 'should return a readable time in hours' do
70
70
  [hour_to_seconds, (day_to_seconds - 1)].each do |seconds|
71
- display_time(seconds).should =~ /[0-9]+ hours$/
71
+ expect(display_time(seconds)).to match(/[0-9]+ hours$/)
72
72
  end
73
73
  end
74
74
  end
@@ -76,7 +76,7 @@ describe Zxcvbn::CrackTime do
76
76
  context 'when less than 31 days' do
77
77
  it 'should return a readable time in days' do
78
78
  [day_to_seconds, month_to_seconds - 1].each do |seconds|
79
- display_time(seconds).should =~ /[0-9]+ days$/
79
+ expect(display_time(seconds)).to match(/[0-9]+ days$/)
80
80
  end
81
81
  end
82
82
  end
@@ -84,7 +84,7 @@ describe Zxcvbn::CrackTime do
84
84
  context 'when less than 1 year' do
85
85
  it 'should return a readable time in days' do
86
86
  [month_to_seconds, (year_to_seconds - 1)].each do |seconds|
87
- display_time(seconds).should =~ /[0-9]+ months$/
87
+ expect(display_time(seconds)).to match(/[0-9]+ months$/)
88
88
  end
89
89
  end
90
90
  end
@@ -92,14 +92,14 @@ describe Zxcvbn::CrackTime do
92
92
  context 'when less than a century' do
93
93
  it 'should return a readable time in days' do
94
94
  [year_to_seconds, (century_to_seconds - 1)].each do |seconds|
95
- display_time(seconds).should =~ /[0-9]+ years$/
95
+ expect(display_time(seconds)).to match(/[0-9]+ years$/)
96
96
  end
97
97
  end
98
98
  end
99
99
 
100
100
  context 'when a century or more' do
101
101
  it 'should return centuries' do
102
- display_time(century_to_seconds).should eql 'centuries'
102
+ expect(display_time(century_to_seconds)).to eql 'centuries'
103
103
  end
104
104
  end
105
105
  end
@@ -15,7 +15,7 @@ describe Zxcvbn::Entropy do
15
15
  describe '#repeat_entropy' do
16
16
  it 'returns the correct value' do
17
17
  match = Zxcvbn::Match.new(:token => '2222')
18
- entropy.repeat_entropy(match).should eq 5.321928094887363
18
+ expect(entropy.repeat_entropy(match)).to eq 5.321928094887363
19
19
  end
20
20
  end
21
21
 
@@ -27,7 +27,7 @@ describe Zxcvbn::Entropy do
27
27
  let(:token) { token }
28
28
 
29
29
  it 'returns the correct value' do
30
- entropy.sequence_entropy(match).should eq 3.807354922057604
30
+ expect(entropy.sequence_entropy(match)).to eq 3.807354922057604
31
31
  end
32
32
  end
33
33
  end
@@ -36,7 +36,7 @@ describe Zxcvbn::Entropy do
36
36
  let(:token) { '23456' }
37
37
 
38
38
  it 'returns the correct value' do
39
- entropy.sequence_entropy(match).should eq 5.643856189774725
39
+ expect(entropy.sequence_entropy(match)).to eq 5.643856189774725
40
40
  end
41
41
  end
42
42
 
@@ -44,7 +44,7 @@ describe Zxcvbn::Entropy do
44
44
  let(:token) { 'bcdef' }
45
45
 
46
46
  it 'returns the correct value' do
47
- entropy.sequence_entropy(match).should eq 7.022367813028454
47
+ expect(entropy.sequence_entropy(match)).to eq 7.022367813028454
48
48
  end
49
49
  end
50
50
 
@@ -52,7 +52,7 @@ describe Zxcvbn::Entropy do
52
52
  let(:token) { 'BCDEF' }
53
53
 
54
54
  it 'returns the correct value' do
55
- entropy.sequence_entropy(match).should eq 8.022367813028454
55
+ expect(entropy.sequence_entropy(match)).to eq 8.022367813028454
56
56
  end
57
57
  end
58
58
 
@@ -61,7 +61,7 @@ describe Zxcvbn::Entropy do
61
61
  let(:token) { 'bcdef' }
62
62
 
63
63
  it 'returns the correct value' do
64
- entropy.sequence_entropy(match).should eq 8.022367813028454
64
+ expect(entropy.sequence_entropy(match)).to eq 8.022367813028454
65
65
  end
66
66
  end
67
67
  end
@@ -69,13 +69,13 @@ describe Zxcvbn::Entropy do
69
69
  describe '#digits_entropy' do
70
70
  it 'returns the correct value' do
71
71
  match = Zxcvbn::Match.new(:token => '12345678')
72
- entropy.digits_entropy(match).should eq 26.5754247590989
72
+ expect(entropy.digits_entropy(match)).to eq 26.5754247590989
73
73
  end
74
74
  end
75
75
 
76
76
  describe '#year_entropy' do
77
77
  it 'returns the correct value' do
78
- entropy.year_entropy(nil).should eq 6.894817763307944
78
+ expect(entropy.year_entropy(nil)).to eq 6.894817763307944
79
79
  end
80
80
  end
81
81
 
@@ -83,21 +83,21 @@ describe Zxcvbn::Entropy do
83
83
  context 'with a two digit year' do
84
84
  it 'returns the correct value' do
85
85
  match = Zxcvbn::Match.new(:year => 98)
86
- entropy.date_entropy(match).should eq 15.183015000882756
86
+ expect(entropy.date_entropy(match)).to eq 15.183015000882756
87
87
  end
88
88
  end
89
89
 
90
90
  context 'with a four digit year' do
91
91
  it 'returns the correct value' do
92
92
  match = Zxcvbn::Match.new(:year => 2012)
93
- entropy.date_entropy(match).should eq 15.433976574415976
93
+ expect(entropy.date_entropy(match)).to eq 15.433976574415976
94
94
  end
95
95
  end
96
96
 
97
97
  context 'with a separator' do
98
98
  it 'returns the correct value' do
99
99
  match = Zxcvbn::Match.new(:year => 2012, :separator => '/')
100
- entropy.date_entropy(match).should eq 17.433976574415976
100
+ expect(entropy.date_entropy(match)).to eq 17.433976574415976
101
101
  end
102
102
  end
103
103
  end
@@ -112,42 +112,42 @@ describe Zxcvbn::Entropy do
112
112
  let(:token) { 'you' }
113
113
  let(:rank) { 1 }
114
114
 
115
- specify { calculated_entropy.should eq 0 }
115
+ specify { expect(calculated_entropy).to eq 0 }
116
116
  end
117
117
 
118
118
  context 'with all upper case characters' do
119
119
  let(:token) { 'YOU' }
120
120
  let(:rank) { 1 }
121
121
 
122
- specify { calculated_entropy.should eq 1 }
122
+ specify { expect(calculated_entropy).to eq 1 }
123
123
  end
124
124
 
125
125
  context 'starting with uppercase' do
126
126
  let(:token) { 'You' }
127
127
  let(:rank) { 1 }
128
128
 
129
- specify { calculated_entropy.should eq 1 }
129
+ specify { expect(calculated_entropy).to eq 1 }
130
130
  end
131
131
 
132
132
  context 'starting with uppercase' do
133
133
  let(:token) { 'yoU' }
134
134
  let(:rank) { 1 }
135
135
 
136
- specify { calculated_entropy.should eq 1 }
136
+ specify { expect(calculated_entropy).to eq 1 }
137
137
  end
138
138
 
139
139
  context 'mixed upper and lower' do
140
140
  let(:token) { 'tEsTiNg' }
141
141
  let(:rank) { 1 }
142
142
 
143
- specify { calculated_entropy.should eq 6 }
143
+ specify { expect(calculated_entropy).to eq 6 }
144
144
  end
145
145
 
146
146
  context 'starting with digits' do
147
147
  let(:token) { '12345' }
148
148
  let(:rank) { 1 }
149
149
 
150
- specify { calculated_entropy.should eq 0 }
150
+ specify { expect(calculated_entropy).to eq 0 }
151
151
  end
152
152
 
153
153
  context 'extra l33t entropy' do
@@ -156,7 +156,7 @@ describe Zxcvbn::Entropy do
156
156
  let(:l33t) { true }
157
157
  let(:sub) { {'3' => 'e', '0' => 'o'} }
158
158
 
159
- specify { calculated_entropy.should eq 1 }
159
+ specify { expect(calculated_entropy).to eq 1 }
160
160
  end
161
161
  end
162
162
 
@@ -167,7 +167,7 @@ describe Zxcvbn::Entropy do
167
167
  it 'should return the correct entropy' do
168
168
  match.graph = 'qwerty'
169
169
 
170
- entropy.spatial_entropy(match).should eql 11.562242424221074
170
+ expect(entropy.spatial_entropy(match)).to eql 11.562242424221074
171
171
  end
172
172
  end
173
173
 
@@ -175,7 +175,7 @@ describe Zxcvbn::Entropy do
175
175
  it 'should return the correct entropy' do
176
176
  match.graph = 'dvorak'
177
177
 
178
- entropy.spatial_entropy(match).should eql 11.562242424221074
178
+ expect(entropy.spatial_entropy(match)).to eql 11.562242424221074
179
179
  end
180
180
  end
181
181
 
@@ -183,7 +183,7 @@ describe Zxcvbn::Entropy do
183
183
  it 'should return the correct entropy' do
184
184
  match.graph = 'keypad'
185
185
 
186
- entropy.spatial_entropy(match).should eql 9.05528243550119
186
+ expect(entropy.spatial_entropy(match)).to eql 9.05528243550119
187
187
  end
188
188
  end
189
189
 
@@ -191,7 +191,7 @@ describe Zxcvbn::Entropy do
191
191
  it 'should return the correct entropy' do
192
192
  match.turns = 5
193
193
 
194
- entropy.spatial_entropy(match).should eql 21.761397858718993
194
+ expect(entropy.spatial_entropy(match)).to eql 21.761397858718993
195
195
  end
196
196
  end
197
197
 
@@ -199,7 +199,7 @@ describe Zxcvbn::Entropy do
199
199
  it 'should return the correct entropy' do
200
200
  match.shiffted_count = 5
201
201
 
202
- entropy.spatial_entropy(match).should eql 9.05528243550119
202
+ expect(entropy.spatial_entropy(match)).to eql 9.05528243550119
203
203
  end
204
204
  end
205
205
 
@@ -208,7 +208,7 @@ describe Zxcvbn::Entropy do
208
208
  match.shiffted_count = 5
209
209
  match.turns = 5
210
210
 
211
- entropy.spatial_entropy(match).should eql 21.761397858718993
211
+ expect(entropy.spatial_entropy(match)).to eql 21.761397858718993
212
212
  end
213
213
  end
214
214
  end