ronin 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.editorconfig +11 -0
- data/.github/workflows/ruby.yml +32 -0
- data/.gitignore +7 -7
- data/.ruby-version +1 -0
- data/COPYING.txt +3 -3
- data/ChangeLog.md +25 -11
- data/Gemfile +21 -20
- data/README.md +102 -81
- data/Rakefile +4 -5
- data/bin/ronin +7 -12
- data/bin/ronin-campaigns +7 -12
- data/bin/ronin-console +7 -12
- data/bin/ronin-creds +7 -12
- data/bin/ronin-database +7 -12
- data/bin/ronin-emails +7 -12
- data/bin/ronin-exec +7 -12
- data/bin/ronin-fuzzer +7 -12
- data/bin/ronin-help +7 -12
- data/bin/ronin-hosts +7 -12
- data/bin/ronin-install +7 -12
- data/bin/ronin-ips +7 -12
- data/bin/ronin-net-proxy +7 -12
- data/bin/ronin-repos +7 -12
- data/bin/ronin-uninstall +7 -12
- data/bin/ronin-update +7 -12
- data/bin/ronin-urls +7 -12
- data/bin/ronin-wordlist +7 -12
- data/gemspec.yml +8 -8
- data/lib/bond/completions/ronin.rb +23 -23
- data/lib/ronin.rb +3 -3
- data/lib/ronin/address.rb +6 -7
- data/lib/ronin/arch.rb +3 -3
- data/lib/ronin/author.rb +5 -7
- data/lib/ronin/auto_load.rb +5 -5
- data/lib/ronin/bootstrap.rb +3 -3
- data/lib/ronin/campaign.rb +3 -3
- data/lib/ronin/config.rb +5 -7
- data/lib/ronin/credential.rb +3 -3
- data/lib/ronin/database.rb +3 -3
- data/lib/ronin/database/database.rb +8 -12
- data/lib/ronin/database/exceptions.rb +3 -3
- data/lib/ronin/database/exceptions/invalid_config.rb +3 -3
- data/lib/ronin/database/exceptions/unknown_repository.rb +3 -3
- data/lib/ronin/database/migrations.rb +3 -3
- data/lib/ronin/database/migrations/1.0.0.rb +3 -3
- data/lib/ronin/database/migrations/1.1.0.rb +3 -3
- data/lib/ronin/database/migrations/exceptions.rb +3 -3
- data/lib/ronin/database/migrations/exceptions/duplicate_migration.rb +3 -3
- data/lib/ronin/database/migrations/exceptions/unknown_migration.rb +3 -3
- data/lib/ronin/database/migrations/graph.rb +3 -3
- data/lib/ronin/database/migrations/migration.rb +3 -3
- data/lib/ronin/database/migrations/migrations.rb +3 -3
- data/lib/ronin/email_address.rb +5 -7
- data/lib/ronin/environment.rb +3 -3
- data/lib/ronin/exceptions.rb +3 -3
- data/lib/ronin/exceptions/duplicate_repository.rb +3 -3
- data/lib/ronin/exceptions/repository_not_found.rb +3 -3
- data/lib/ronin/host_name.rb +3 -3
- data/lib/ronin/host_name_ip_address.rb +3 -3
- data/lib/ronin/installation.rb +5 -7
- data/lib/ronin/ip_address.rb +6 -8
- data/lib/ronin/ip_address_mac_address.rb +3 -3
- data/lib/ronin/license.rb +6 -6
- data/lib/ronin/mac_address.rb +3 -3
- data/lib/ronin/model.rb +3 -3
- data/lib/ronin/model/has_authors.rb +3 -3
- data/lib/ronin/model/has_description.rb +3 -3
- data/lib/ronin/model/has_license.rb +3 -3
- data/lib/ronin/model/has_name.rb +3 -3
- data/lib/ronin/model/has_title.rb +3 -3
- data/lib/ronin/model/has_unique_name.rb +5 -7
- data/lib/ronin/model/has_version.rb +3 -3
- data/lib/ronin/model/importable.rb +3 -3
- data/lib/ronin/model/model.rb +7 -8
- data/lib/ronin/model/types.rb +3 -3
- data/lib/ronin/model/types/description.rb +9 -12
- data/lib/ronin/open_port.rb +5 -7
- data/lib/ronin/organization.rb +3 -3
- data/lib/ronin/os.rb +5 -7
- data/lib/ronin/os_guess.rb +3 -3
- data/lib/ronin/password.rb +3 -3
- data/lib/ronin/port.rb +3 -3
- data/lib/ronin/repositories.rb +3 -3
- data/lib/ronin/repository.rb +3 -3
- data/lib/ronin/ronin.rb +3 -3
- data/lib/ronin/script.rb +3 -3
- data/lib/ronin/script/buildable.rb +3 -3
- data/lib/ronin/script/deployable.rb +3 -3
- data/lib/ronin/script/exceptions.rb +3 -3
- data/lib/ronin/script/exceptions/build_failed.rb +3 -3
- data/lib/ronin/script/exceptions/deploy_failed.rb +3 -3
- data/lib/ronin/script/exceptions/exception.rb +3 -3
- data/lib/ronin/script/exceptions/not_built.rb +3 -3
- data/lib/ronin/script/exceptions/test_failed.rb +3 -3
- data/lib/ronin/script/path.rb +3 -3
- data/lib/ronin/script/script.rb +3 -3
- data/lib/ronin/script/testable.rb +3 -3
- data/lib/ronin/service.rb +3 -3
- data/lib/ronin/service_credential.rb +3 -3
- data/lib/ronin/software.rb +3 -3
- data/lib/ronin/spec/database.rb +27 -21
- data/lib/ronin/target.rb +3 -3
- data/lib/ronin/tcp_port.rb +3 -3
- data/lib/ronin/udp_port.rb +3 -3
- data/lib/ronin/ui.rb +3 -3
- data/lib/ronin/ui/cli.rb +3 -3
- data/lib/ronin/ui/cli/class_command.rb +14 -7
- data/lib/ronin/ui/cli/cli.rb +5 -5
- data/lib/ronin/ui/cli/command.rb +5 -7
- data/lib/ronin/ui/cli/commands.rb +3 -3
- data/lib/ronin/ui/cli/commands/campaigns.rb +5 -7
- data/lib/ronin/ui/cli/commands/console.rb +3 -3
- data/lib/ronin/ui/cli/commands/creds.rb +3 -3
- data/lib/ronin/ui/cli/commands/database.rb +3 -3
- data/lib/ronin/ui/cli/commands/emails.rb +3 -3
- data/lib/ronin/ui/cli/commands/exec.rb +3 -3
- data/lib/ronin/ui/cli/commands/fuzzer.rb +16 -16
- data/lib/ronin/ui/cli/commands/help.rb +3 -3
- data/lib/ronin/ui/cli/commands/hosts.rb +5 -7
- data/lib/ronin/ui/cli/commands/install.rb +7 -11
- data/lib/ronin/ui/cli/commands/ips.rb +5 -7
- data/lib/ronin/ui/cli/commands/net/proxy.rb +19 -12
- data/lib/ronin/ui/cli/commands/repos.rb +3 -3
- data/lib/ronin/ui/cli/commands/uninstall.rb +3 -3
- data/lib/ronin/ui/cli/commands/update.rb +3 -3
- data/lib/ronin/ui/cli/commands/urls.rb +3 -3
- data/lib/ronin/ui/cli/commands/wordlist.rb +3 -3
- data/lib/ronin/ui/cli/exceptions.rb +3 -3
- data/lib/ronin/ui/cli/exceptions/unknown_command.rb +3 -3
- data/lib/ronin/ui/cli/model_command.rb +6 -9
- data/lib/ronin/ui/cli/printing.rb +3 -3
- data/lib/ronin/ui/cli/resources_command.rb +7 -11
- data/lib/ronin/ui/cli/script_command.rb +5 -10
- data/lib/ronin/ui/console.rb +3 -3
- data/lib/ronin/ui/console/commands.rb +3 -3
- data/lib/ronin/ui/console/console.rb +3 -3
- data/lib/ronin/ui/console/context.rb +3 -3
- data/lib/ronin/ui/console/shell.rb +3 -3
- data/lib/ronin/url.rb +5 -7
- data/lib/ronin/url_query_param.rb +3 -3
- data/lib/ronin/url_query_param_name.rb +6 -6
- data/lib/ronin/url_scheme.rb +4 -4
- data/lib/ronin/user_name.rb +3 -3
- data/lib/ronin/vendor.rb +3 -3
- data/lib/ronin/version.rb +5 -5
- data/lib/ronin/web_credential.rb +5 -7
- data/man/ronin-campaigns.1.md +20 -20
- data/man/ronin-console.1.md +17 -17
- data/man/ronin-creds.1.md +16 -16
- data/man/ronin-database.1.md +23 -23
- data/man/ronin-emails.1.md +18 -18
- data/man/ronin-exec.1.md +11 -11
- data/man/ronin-fuzzer.1.md +23 -23
- data/man/ronin-help.1.md +5 -5
- data/man/ronin-hosts.1.md +20 -20
- data/man/ronin-install.1.md +18 -18
- data/man/ronin-ips.1.md +21 -21
- data/man/ronin-net-proxy.1.md +24 -24
- data/man/ronin-repos.1.md +18 -18
- data/man/ronin-uninstall.1.md +14 -14
- data/man/ronin-update.1.md +14 -14
- data/man/ronin-urls.1.md +22 -22
- data/man/ronin-wordlist.1.md +14 -13
- data/man/ronin.1.md +1 -1
- data/spec/arch_spec.rb +59 -46
- data/spec/author_spec.rb +14 -14
- data/spec/campaign_spec.rb +8 -0
- data/spec/credential_spec.rb +11 -8
- data/spec/database_spec.rb +6 -6
- data/spec/email_address_spec.rb +23 -20
- data/spec/host_name_spec.rb +24 -22
- data/spec/installation_spec.rb +6 -6
- data/spec/ip_address_spec.rb +31 -26
- data/spec/license_spec.rb +15 -9
- data/spec/mac_address_spec.rb +17 -8
- data/spec/model/has_authors_spec.rb +56 -37
- data/spec/model/has_description_spec.rb +36 -23
- data/spec/model/has_license_spec.rb +38 -28
- data/spec/model/has_name_spec.rb +36 -19
- data/spec/model/has_title_spec.rb +27 -14
- data/spec/model/has_version_spec.rb +64 -35
- data/spec/model/model_spec.rb +57 -33
- data/spec/model/models/{basic_model.rb → base_model.rb} +1 -1
- data/spec/model/models/{custom_model.rb → inherited_model.rb} +2 -3
- data/spec/os_spec.rb +24 -20
- data/spec/password_spec.rb +17 -9
- data/spec/port_spec.rb +30 -22
- data/spec/repository_spec.rb +59 -60
- data/spec/ronin_spec.rb +4 -4
- data/spec/script/buildable_spec.rb +8 -8
- data/spec/script/deployable_spec.rb +7 -7
- data/spec/script/path_spec.rb +42 -40
- data/spec/script/script_spec.rb +23 -23
- data/spec/script/testable_spec.rb +20 -20
- data/spec/service_spec.rb +14 -8
- data/spec/software_spec.rb +30 -17
- data/spec/spec_helper.rb +4 -4
- data/spec/ui/cli/classes/test_command.rb +2 -4
- data/spec/ui/cli/cli_spec.rb +5 -5
- data/spec/ui/cli/command_spec.rb +34 -30
- data/spec/url_query_param_spec.rb +23 -14
- data/spec/url_scheme_spec.rb +12 -9
- data/spec/url_spec.rb +64 -61
- data/spec/vendor_spec.rb +15 -8
- metadata +122 -150
- data/.gemtest +0 -0
data/man/ronin-uninstall.1.md
CHANGED
@@ -11,52 +11,52 @@ Uninstalls a Ronin Repositories.
|
|
11
11
|
## ARGUMENTS
|
12
12
|
|
13
13
|
*REPO*
|
14
|
-
|
14
|
+
The name of the Repository to uninstall.
|
15
15
|
|
16
16
|
## OPTIONS
|
17
17
|
|
18
18
|
`-v`, `--[no-]verbose`
|
19
|
-
|
19
|
+
Enable verbose output.
|
20
20
|
|
21
21
|
`-q`, `--[no-]quiet`
|
22
|
-
|
22
|
+
Disable verbose output.
|
23
23
|
|
24
24
|
`--[no-]silent`
|
25
|
-
|
25
|
+
Silence all output.
|
26
26
|
|
27
27
|
`--[no-]color`
|
28
|
-
|
28
|
+
Enables color output.
|
29
29
|
|
30
30
|
## EXAMPLES
|
31
31
|
|
32
32
|
`ronin uninstall repo`
|
33
|
-
|
33
|
+
Uninstalls the repository with with the name `repo`.
|
34
34
|
|
35
35
|
`ronin uninstall repo@github.com`
|
36
|
-
|
36
|
+
Uninstalls the repository with the name `repo` and from `github.com`.
|
37
37
|
|
38
38
|
## FILES
|
39
39
|
|
40
40
|
*~/.ronin/*
|
41
|
-
|
41
|
+
Ronin configuration directory.
|
42
42
|
|
43
43
|
*~/.ronin/repos/*
|
44
|
-
|
44
|
+
Installation directory for Ronin Repositories.
|
45
45
|
|
46
46
|
*~/.ronin/database.log*
|
47
|
-
|
47
|
+
Database log.
|
48
48
|
|
49
49
|
*~/.ronin/database.sqlite3*
|
50
|
-
|
50
|
+
The default sqlite3 Database file.
|
51
51
|
|
52
52
|
*~/.ronin/database.yml*
|
53
|
-
|
53
|
+
Optional Database configuration.
|
54
54
|
|
55
55
|
## ENVIRONMENT
|
56
56
|
|
57
57
|
HOME
|
58
|
-
|
59
|
-
|
58
|
+
Specifies the home directory of the user. Ronin will search for the
|
59
|
+
*~/.ronin/* configuration directory within the home directory.
|
60
60
|
|
61
61
|
## AUTHOR
|
62
62
|
|
data/man/ronin-update.1.md
CHANGED
@@ -11,52 +11,52 @@ Updates Ronin Repositories.
|
|
11
11
|
## ARGUMENTS
|
12
12
|
|
13
13
|
*REPO*
|
14
|
-
|
14
|
+
The name of the Repository to update.
|
15
15
|
|
16
16
|
## OPTIONS
|
17
17
|
|
18
18
|
`-v`, `--[no-]verbose`
|
19
|
-
|
19
|
+
Enable verbose output.
|
20
20
|
|
21
21
|
`-q`, `--[no-]quiet`
|
22
|
-
|
22
|
+
Disable verbose output.
|
23
23
|
|
24
24
|
`--[no-]silent`
|
25
|
-
|
25
|
+
Silence all output.
|
26
26
|
|
27
27
|
`--[no-]color`
|
28
|
-
|
28
|
+
Enables color output.
|
29
29
|
|
30
30
|
## EXAMPLES
|
31
31
|
|
32
32
|
`ronin update repo`
|
33
|
-
|
33
|
+
Updates the repository with with the name `repo`.
|
34
34
|
|
35
35
|
`ronin update repo@github.com`
|
36
|
-
|
36
|
+
Updates the repository with the name `repo` and from `github.com`.
|
37
37
|
|
38
38
|
## FILES
|
39
39
|
|
40
40
|
*~/.ronin/*
|
41
|
-
|
41
|
+
Ronin configuration directory.
|
42
42
|
|
43
43
|
*~/.ronin/repos*
|
44
|
-
|
44
|
+
Installation directory for Ronin Repositories.
|
45
45
|
|
46
46
|
*~/.ronin/database.log*
|
47
|
-
|
47
|
+
Database log.
|
48
48
|
|
49
49
|
*~/.ronin/database.sqlite3*
|
50
|
-
|
50
|
+
The default sqlite3 Database file.
|
51
51
|
|
52
52
|
*~/.ronin/database.yml*
|
53
|
-
|
53
|
+
Optional Database configuration.
|
54
54
|
|
55
55
|
## ENVIRONMENT
|
56
56
|
|
57
57
|
HOME
|
58
|
-
|
59
|
-
|
58
|
+
Specifies the home directory of the user. Ronin will search for the
|
59
|
+
*~/.ronin/* configuration directory within the home directory.
|
60
60
|
|
61
61
|
## AUTHOR
|
62
62
|
|
data/man/ronin-urls.1.md
CHANGED
@@ -11,72 +11,72 @@ Manages URLs.
|
|
11
11
|
## OPTIONS
|
12
12
|
|
13
13
|
`-v`, `--[no-]verbose`
|
14
|
-
|
14
|
+
Enable verbose output.
|
15
15
|
|
16
16
|
`-q`, `--[no-]quiet`
|
17
|
-
|
17
|
+
Disable verbose output.
|
18
18
|
|
19
19
|
`--[no-]silent`
|
20
|
-
|
20
|
+
Silence all output.
|
21
21
|
|
22
22
|
`--[no-]color`
|
23
|
-
|
23
|
+
Enables color output.
|
24
24
|
|
25
25
|
`-D`, `--database` *URI*
|
26
|
-
|
26
|
+
The database to URI (`mysql://user:password@host/ronin`).
|
27
27
|
|
28
28
|
`--[no-]csv`
|
29
|
-
|
29
|
+
CSV output.
|
30
30
|
|
31
31
|
`--[no-]xml`
|
32
|
-
|
32
|
+
XML output.
|
33
33
|
|
34
34
|
`--[no-]yaml`
|
35
|
-
|
35
|
+
YAML output.
|
36
36
|
|
37
37
|
`--[no-]json`
|
38
|
-
|
38
|
+
JSON output.
|
39
39
|
|
40
40
|
`-i`, `--import` *FILE*
|
41
|
-
|
41
|
+
Imports HostNames from the FILE.
|
42
42
|
|
43
43
|
`--[no-]http`
|
44
|
-
|
44
|
+
Searches for `http://` URLs.
|
45
45
|
|
46
46
|
`--[no-]https`
|
47
|
-
|
47
|
+
Searches for `https://` URLs.
|
48
48
|
|
49
49
|
`-H`, `--hosts` *HOST* [...]
|
50
|
-
|
50
|
+
Searches for URLs with the given HOST name(s).
|
51
51
|
|
52
52
|
`-p`, `--with-ports` *PORT* [...]
|
53
|
-
|
53
|
+
Searches for URLs associated with the PORT(s).
|
54
54
|
|
55
55
|
`-d`, `--directory` *DIRECTORY*
|
56
|
-
|
56
|
+
Searches for URLs sharing the DIRECTORY.
|
57
57
|
|
58
58
|
`-q`, `--with-query-param` *NAME* [...]
|
59
|
-
|
59
|
+
Searches for URLs containing the query-param NAME.
|
60
60
|
|
61
61
|
`-Q`, `--with-query-value` *VALUE* [...]
|
62
|
-
|
62
|
+
Searches for URLs containing the query-param VALUE.
|
63
63
|
|
64
64
|
`-l`, `--[no-]list`
|
65
|
-
|
65
|
+
Lists the HostNames.
|
66
66
|
|
67
67
|
## FILES
|
68
68
|
|
69
69
|
*~/.ronin/*
|
70
|
-
|
70
|
+
Ronin configuration directory.
|
71
71
|
|
72
72
|
*~/.ronin/database.log*
|
73
|
-
|
73
|
+
Database log.
|
74
74
|
|
75
75
|
*~/.ronin/database.sqlite3*
|
76
|
-
|
76
|
+
The default sqlite3 Database file.
|
77
77
|
|
78
78
|
*~/.ronin/database.yml*
|
79
|
-
|
79
|
+
Optional Database configuration.
|
80
80
|
|
81
81
|
## AUTHOR
|
82
82
|
|
data/man/ronin-wordlist.1.md
CHANGED
@@ -11,41 +11,42 @@ Builds and/or mutates Wordlists.
|
|
11
11
|
## ARGUMENTS
|
12
12
|
|
13
13
|
*TEMPLATE*
|
14
|
-
|
14
|
+
Options word template to generate the wordlist with
|
15
|
+
(`alpha:7 numeric:1-3`).
|
15
16
|
|
16
17
|
## OPTIONS
|
17
18
|
|
18
19
|
`-v`, `--[no-]verbose`
|
19
|
-
|
20
|
+
Enable verbose output.
|
20
21
|
|
21
22
|
`-q`, `--[no-]quiet`
|
22
|
-
|
23
|
+
Disable verbose output.
|
23
24
|
|
24
25
|
`--[no-]silent`
|
25
|
-
|
26
|
+
Silence all output.
|
26
27
|
|
27
28
|
`--[no-]color`
|
28
|
-
|
29
|
+
Enables color output.
|
29
30
|
|
30
31
|
`-i`, `--input` *FILE*
|
31
|
-
|
32
|
+
The input text FILE to parse.
|
32
33
|
|
33
34
|
`-o`, `--output` *PATH*
|
34
|
-
|
35
|
+
The output PATH to write the wordlist to.
|
35
36
|
|
36
37
|
`-m`, `--mutations` *STRING*:*SUBSTITUTE*
|
37
|
-
|
38
|
-
|
38
|
+
Mutations to apply to the words. If STRING is found within a word,
|
39
|
+
it will be replaced with SUBSTITUTE.
|
39
40
|
|
40
41
|
## EXAMPLES
|
41
42
|
|
42
43
|
`ronin wordlist alpha:7 numeric:1-3`
|
43
|
-
|
44
|
-
|
44
|
+
Enumerates through every possible word, with each word beginning with
|
45
|
+
seven alphabetic characters and ending in 1-3 numeric characters.
|
45
46
|
|
46
47
|
`ronin wordlist --input text.txt -m e:3 -m a:@ -m o:0`
|
47
|
-
|
48
|
-
|
48
|
+
Builds a wordlist from a text file, applying basic "leet-speak"
|
49
|
+
mutation rules to each word.
|
49
50
|
|
50
51
|
## AUTHOR
|
51
52
|
|
data/man/ronin.1.md
CHANGED
data/spec/arch_spec.rb
CHANGED
@@ -1,64 +1,77 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
|
2
3
|
require 'ronin/arch'
|
3
4
|
|
4
5
|
describe Arch do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
arch.name = 'future'
|
10
|
-
arch.should_not be_valid
|
11
|
-
|
12
|
-
arch.endian = 'little'
|
13
|
-
arch.should_not be_valid
|
6
|
+
describe "validations" do
|
7
|
+
it "should require a name, endian and address_length attributes" do
|
8
|
+
expect(subject).not_to be_valid
|
14
9
|
|
15
|
-
|
16
|
-
|
17
|
-
end
|
10
|
+
subject.name = 'future'
|
11
|
+
expect(subject).not_to be_valid
|
18
12
|
|
19
|
-
|
20
|
-
|
21
|
-
:endian => 'little',
|
22
|
-
:address_length => 4)
|
23
|
-
first_arch.should be_valid
|
13
|
+
subject.endian = 'little'
|
14
|
+
expect(subject).not_to be_valid
|
24
15
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
second_arch.should_not be_valid
|
29
|
-
end
|
16
|
+
subject.address_length = 4
|
17
|
+
expect(subject).to be_valid
|
18
|
+
end
|
30
19
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
20
|
+
describe "name" do
|
21
|
+
before do
|
22
|
+
described_class.create(
|
23
|
+
:name => 'cats',
|
24
|
+
:endian => 'little',
|
25
|
+
:address_length => 4
|
26
|
+
)
|
27
|
+
end
|
36
28
|
|
37
|
-
|
38
|
-
|
29
|
+
subject do
|
30
|
+
described_class.new(
|
31
|
+
:name => 'cats',
|
32
|
+
:endian => 'big',
|
33
|
+
:address_length => 4
|
34
|
+
)
|
35
|
+
end
|
39
36
|
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
it "should require a unique name" do
|
38
|
+
expect(subject).not_to be_valid
|
39
|
+
end
|
40
|
+
end
|
43
41
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
42
|
+
describe "endian" do
|
43
|
+
subject do
|
44
|
+
described_class.new(
|
45
|
+
:name => 'test',
|
46
|
+
:address_length => 4
|
47
|
+
)
|
48
|
+
end
|
49
49
|
|
50
|
-
|
51
|
-
|
50
|
+
it "should accept 'little'" do
|
51
|
+
subject.endian = 'little'
|
52
|
+
expect(subject).to be_valid
|
53
|
+
end
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
-
|
55
|
+
it "should accept 'big'" do
|
56
|
+
subject.endian = 'big'
|
57
|
+
expect(subject).to be_valid
|
58
|
+
end
|
56
59
|
|
57
|
-
|
58
|
-
|
60
|
+
context "otherwise" do
|
61
|
+
it { should_not be_valid }
|
62
|
+
end
|
63
|
+
end
|
59
64
|
end
|
60
65
|
|
61
|
-
|
62
|
-
|
66
|
+
describe "predefined archs" do
|
67
|
+
subject { described_class }
|
68
|
+
|
69
|
+
it "should provide built-in archs" do
|
70
|
+
expect(subject.i386).not_to be_nil
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should allow custom names for built-in archs" do
|
74
|
+
expect(subject.x86_64.name).to eq('x86-64')
|
75
|
+
end
|
63
76
|
end
|
64
77
|
end
|
data/spec/author_spec.rb
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
|
2
3
|
require 'ronin/author'
|
3
4
|
|
4
5
|
describe Author do
|
5
|
-
it "should have a String representation" do
|
6
|
-
author = Author.new(:name => 'test')
|
7
|
-
author.to_s.should == 'test'
|
8
|
-
end
|
9
|
-
|
10
6
|
describe "#to_s" do
|
11
|
-
|
12
|
-
author = Author.new(:name => 'anonymous')
|
7
|
+
subject { described_class.new(:name => 'anonymous') }
|
13
8
|
|
14
|
-
|
9
|
+
it "should return the name when their is no email" do
|
10
|
+
expect(subject.to_s).to eq('anonymous')
|
15
11
|
end
|
16
12
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
context "when email is set" do
|
14
|
+
subject do
|
15
|
+
described_class.new(
|
16
|
+
:name => 'anonymous',
|
17
|
+
:email => 'anonymous@example.com'
|
18
|
+
)
|
19
|
+
end
|
22
20
|
|
23
|
-
|
21
|
+
it "should return the name and email when both are present" do
|
22
|
+
expect(subject.to_s).to eq('anonymous <anonymous@example.com>')
|
23
|
+
end
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|