easy_passwords 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/.travis.yml +13 -0
- data/Gemfile +2 -0
- data/README.md +49 -0
- data/Rakefile +12 -0
- data/easy_passwords.gemspec +25 -0
- data/lib/easy_passwords.rb +2 -0
- data/lib/easy_passwords/easy_passwords.rb +104 -0
- data/lib/easy_passwords/version.rb +3 -0
- data/lib/easy_passwords/wordlist.rb +4160 -0
- data/spec/lib/easy_passwords_spec.rb +56 -0
- data/spec/spec_helper.rb +1 -0
- metadata +107 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe EasyPasswords do
|
4
|
+
it "should return a random password" do
|
5
|
+
password = EasyPasswords.generate
|
6
|
+
debugger
|
7
|
+
password.should_not be_nil
|
8
|
+
password.should_not be_empty
|
9
|
+
password.should be_kind_of(String)
|
10
|
+
password.length.should be_within(7).of(10)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should return a short random password when given a length of 5" do
|
14
|
+
password = EasyPasswords.generate 5
|
15
|
+
password.should_not be_nil
|
16
|
+
password.should_not be_empty
|
17
|
+
password.should be_kind_of(String)
|
18
|
+
password.length.should be_within(3).of(5)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should return a longer random password when given a max length of 12" do
|
22
|
+
password = EasyPasswords.generate 12
|
23
|
+
password.should_not be_nil
|
24
|
+
password.should_not be_empty
|
25
|
+
password.should be_kind_of(String)
|
26
|
+
password.length.should be_within(9).of(12)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should return a EasyPasswords::Generator object when EasyPasswords.new is called" do
|
30
|
+
obj = EasyPasswords.new
|
31
|
+
obj.should_not be_nil
|
32
|
+
obj.should be_an_instance_of(EasyPasswords::Generator)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe EasyPasswords::Generator do
|
37
|
+
it "should return a random password" do
|
38
|
+
password = EasyPasswords::Generator.new.generate
|
39
|
+
password.should_not be_nil
|
40
|
+
password.should_not be_empty
|
41
|
+
password.should be_kind_of(String)
|
42
|
+
password.length.should be_within(5).of(15)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should raise error when given a length of 1" do
|
46
|
+
expect {EasyPasswords::Generator.new.generate 1}.to raise_error
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should return a longer random password when given a length of 5" do
|
50
|
+
password = EasyPasswords::Generator.new.generate 5
|
51
|
+
password.should_not be_nil
|
52
|
+
password.should_not be_empty
|
53
|
+
password.should be_kind_of(String)
|
54
|
+
password.length.should be_within(3).of(5)
|
55
|
+
end
|
56
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'easy_passwords'
|
metadata
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: easy_passwords
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Pete
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-10-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: debugger
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: Easy password is a Ruby implementation of passwdqc's easy_passwords,
|
63
|
+
a random pronouncable password generator. Don't use it for serious projects :)
|
64
|
+
email: piotr.bliszczyk@gmail.com
|
65
|
+
executables: []
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files: []
|
68
|
+
files:
|
69
|
+
- .gitignore
|
70
|
+
- .travis.yml
|
71
|
+
- Gemfile
|
72
|
+
- README.md
|
73
|
+
- Rakefile
|
74
|
+
- easy_passwords.gemspec
|
75
|
+
- lib/easy_passwords.rb
|
76
|
+
- lib/easy_passwords/easy_passwords.rb
|
77
|
+
- lib/easy_passwords/version.rb
|
78
|
+
- lib/easy_passwords/wordlist.rb
|
79
|
+
- spec/lib/easy_passwords_spec.rb
|
80
|
+
- spec/spec_helper.rb
|
81
|
+
homepage: https://github.com/piotrze/easy_passwords
|
82
|
+
licenses: []
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options: []
|
85
|
+
require_paths:
|
86
|
+
- lib
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ! '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 1.8.7
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 1.3.6
|
99
|
+
requirements: []
|
100
|
+
rubyforge_project:
|
101
|
+
rubygems_version: 1.8.25
|
102
|
+
signing_key:
|
103
|
+
specification_version: 3
|
104
|
+
summary: Easy passwords generator in Ruby
|
105
|
+
test_files:
|
106
|
+
- spec/lib/easy_passwords_spec.rb
|
107
|
+
- spec/spec_helper.rb
|