ronin 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +11 -0
  3. data/.github/workflows/ruby.yml +32 -0
  4. data/.gitignore +7 -7
  5. data/.ruby-version +1 -0
  6. data/COPYING.txt +3 -3
  7. data/ChangeLog.md +25 -11
  8. data/Gemfile +21 -20
  9. data/README.md +102 -81
  10. data/Rakefile +4 -5
  11. data/bin/ronin +7 -12
  12. data/bin/ronin-campaigns +7 -12
  13. data/bin/ronin-console +7 -12
  14. data/bin/ronin-creds +7 -12
  15. data/bin/ronin-database +7 -12
  16. data/bin/ronin-emails +7 -12
  17. data/bin/ronin-exec +7 -12
  18. data/bin/ronin-fuzzer +7 -12
  19. data/bin/ronin-help +7 -12
  20. data/bin/ronin-hosts +7 -12
  21. data/bin/ronin-install +7 -12
  22. data/bin/ronin-ips +7 -12
  23. data/bin/ronin-net-proxy +7 -12
  24. data/bin/ronin-repos +7 -12
  25. data/bin/ronin-uninstall +7 -12
  26. data/bin/ronin-update +7 -12
  27. data/bin/ronin-urls +7 -12
  28. data/bin/ronin-wordlist +7 -12
  29. data/gemspec.yml +8 -8
  30. data/lib/bond/completions/ronin.rb +23 -23
  31. data/lib/ronin.rb +3 -3
  32. data/lib/ronin/address.rb +6 -7
  33. data/lib/ronin/arch.rb +3 -3
  34. data/lib/ronin/author.rb +5 -7
  35. data/lib/ronin/auto_load.rb +5 -5
  36. data/lib/ronin/bootstrap.rb +3 -3
  37. data/lib/ronin/campaign.rb +3 -3
  38. data/lib/ronin/config.rb +5 -7
  39. data/lib/ronin/credential.rb +3 -3
  40. data/lib/ronin/database.rb +3 -3
  41. data/lib/ronin/database/database.rb +8 -12
  42. data/lib/ronin/database/exceptions.rb +3 -3
  43. data/lib/ronin/database/exceptions/invalid_config.rb +3 -3
  44. data/lib/ronin/database/exceptions/unknown_repository.rb +3 -3
  45. data/lib/ronin/database/migrations.rb +3 -3
  46. data/lib/ronin/database/migrations/1.0.0.rb +3 -3
  47. data/lib/ronin/database/migrations/1.1.0.rb +3 -3
  48. data/lib/ronin/database/migrations/exceptions.rb +3 -3
  49. data/lib/ronin/database/migrations/exceptions/duplicate_migration.rb +3 -3
  50. data/lib/ronin/database/migrations/exceptions/unknown_migration.rb +3 -3
  51. data/lib/ronin/database/migrations/graph.rb +3 -3
  52. data/lib/ronin/database/migrations/migration.rb +3 -3
  53. data/lib/ronin/database/migrations/migrations.rb +3 -3
  54. data/lib/ronin/email_address.rb +5 -7
  55. data/lib/ronin/environment.rb +3 -3
  56. data/lib/ronin/exceptions.rb +3 -3
  57. data/lib/ronin/exceptions/duplicate_repository.rb +3 -3
  58. data/lib/ronin/exceptions/repository_not_found.rb +3 -3
  59. data/lib/ronin/host_name.rb +3 -3
  60. data/lib/ronin/host_name_ip_address.rb +3 -3
  61. data/lib/ronin/installation.rb +5 -7
  62. data/lib/ronin/ip_address.rb +6 -8
  63. data/lib/ronin/ip_address_mac_address.rb +3 -3
  64. data/lib/ronin/license.rb +6 -6
  65. data/lib/ronin/mac_address.rb +3 -3
  66. data/lib/ronin/model.rb +3 -3
  67. data/lib/ronin/model/has_authors.rb +3 -3
  68. data/lib/ronin/model/has_description.rb +3 -3
  69. data/lib/ronin/model/has_license.rb +3 -3
  70. data/lib/ronin/model/has_name.rb +3 -3
  71. data/lib/ronin/model/has_title.rb +3 -3
  72. data/lib/ronin/model/has_unique_name.rb +5 -7
  73. data/lib/ronin/model/has_version.rb +3 -3
  74. data/lib/ronin/model/importable.rb +3 -3
  75. data/lib/ronin/model/model.rb +7 -8
  76. data/lib/ronin/model/types.rb +3 -3
  77. data/lib/ronin/model/types/description.rb +9 -12
  78. data/lib/ronin/open_port.rb +5 -7
  79. data/lib/ronin/organization.rb +3 -3
  80. data/lib/ronin/os.rb +5 -7
  81. data/lib/ronin/os_guess.rb +3 -3
  82. data/lib/ronin/password.rb +3 -3
  83. data/lib/ronin/port.rb +3 -3
  84. data/lib/ronin/repositories.rb +3 -3
  85. data/lib/ronin/repository.rb +3 -3
  86. data/lib/ronin/ronin.rb +3 -3
  87. data/lib/ronin/script.rb +3 -3
  88. data/lib/ronin/script/buildable.rb +3 -3
  89. data/lib/ronin/script/deployable.rb +3 -3
  90. data/lib/ronin/script/exceptions.rb +3 -3
  91. data/lib/ronin/script/exceptions/build_failed.rb +3 -3
  92. data/lib/ronin/script/exceptions/deploy_failed.rb +3 -3
  93. data/lib/ronin/script/exceptions/exception.rb +3 -3
  94. data/lib/ronin/script/exceptions/not_built.rb +3 -3
  95. data/lib/ronin/script/exceptions/test_failed.rb +3 -3
  96. data/lib/ronin/script/path.rb +3 -3
  97. data/lib/ronin/script/script.rb +3 -3
  98. data/lib/ronin/script/testable.rb +3 -3
  99. data/lib/ronin/service.rb +3 -3
  100. data/lib/ronin/service_credential.rb +3 -3
  101. data/lib/ronin/software.rb +3 -3
  102. data/lib/ronin/spec/database.rb +27 -21
  103. data/lib/ronin/target.rb +3 -3
  104. data/lib/ronin/tcp_port.rb +3 -3
  105. data/lib/ronin/udp_port.rb +3 -3
  106. data/lib/ronin/ui.rb +3 -3
  107. data/lib/ronin/ui/cli.rb +3 -3
  108. data/lib/ronin/ui/cli/class_command.rb +14 -7
  109. data/lib/ronin/ui/cli/cli.rb +5 -5
  110. data/lib/ronin/ui/cli/command.rb +5 -7
  111. data/lib/ronin/ui/cli/commands.rb +3 -3
  112. data/lib/ronin/ui/cli/commands/campaigns.rb +5 -7
  113. data/lib/ronin/ui/cli/commands/console.rb +3 -3
  114. data/lib/ronin/ui/cli/commands/creds.rb +3 -3
  115. data/lib/ronin/ui/cli/commands/database.rb +3 -3
  116. data/lib/ronin/ui/cli/commands/emails.rb +3 -3
  117. data/lib/ronin/ui/cli/commands/exec.rb +3 -3
  118. data/lib/ronin/ui/cli/commands/fuzzer.rb +16 -16
  119. data/lib/ronin/ui/cli/commands/help.rb +3 -3
  120. data/lib/ronin/ui/cli/commands/hosts.rb +5 -7
  121. data/lib/ronin/ui/cli/commands/install.rb +7 -11
  122. data/lib/ronin/ui/cli/commands/ips.rb +5 -7
  123. data/lib/ronin/ui/cli/commands/net/proxy.rb +19 -12
  124. data/lib/ronin/ui/cli/commands/repos.rb +3 -3
  125. data/lib/ronin/ui/cli/commands/uninstall.rb +3 -3
  126. data/lib/ronin/ui/cli/commands/update.rb +3 -3
  127. data/lib/ronin/ui/cli/commands/urls.rb +3 -3
  128. data/lib/ronin/ui/cli/commands/wordlist.rb +3 -3
  129. data/lib/ronin/ui/cli/exceptions.rb +3 -3
  130. data/lib/ronin/ui/cli/exceptions/unknown_command.rb +3 -3
  131. data/lib/ronin/ui/cli/model_command.rb +6 -9
  132. data/lib/ronin/ui/cli/printing.rb +3 -3
  133. data/lib/ronin/ui/cli/resources_command.rb +7 -11
  134. data/lib/ronin/ui/cli/script_command.rb +5 -10
  135. data/lib/ronin/ui/console.rb +3 -3
  136. data/lib/ronin/ui/console/commands.rb +3 -3
  137. data/lib/ronin/ui/console/console.rb +3 -3
  138. data/lib/ronin/ui/console/context.rb +3 -3
  139. data/lib/ronin/ui/console/shell.rb +3 -3
  140. data/lib/ronin/url.rb +5 -7
  141. data/lib/ronin/url_query_param.rb +3 -3
  142. data/lib/ronin/url_query_param_name.rb +6 -6
  143. data/lib/ronin/url_scheme.rb +4 -4
  144. data/lib/ronin/user_name.rb +3 -3
  145. data/lib/ronin/vendor.rb +3 -3
  146. data/lib/ronin/version.rb +5 -5
  147. data/lib/ronin/web_credential.rb +5 -7
  148. data/man/ronin-campaigns.1.md +20 -20
  149. data/man/ronin-console.1.md +17 -17
  150. data/man/ronin-creds.1.md +16 -16
  151. data/man/ronin-database.1.md +23 -23
  152. data/man/ronin-emails.1.md +18 -18
  153. data/man/ronin-exec.1.md +11 -11
  154. data/man/ronin-fuzzer.1.md +23 -23
  155. data/man/ronin-help.1.md +5 -5
  156. data/man/ronin-hosts.1.md +20 -20
  157. data/man/ronin-install.1.md +18 -18
  158. data/man/ronin-ips.1.md +21 -21
  159. data/man/ronin-net-proxy.1.md +24 -24
  160. data/man/ronin-repos.1.md +18 -18
  161. data/man/ronin-uninstall.1.md +14 -14
  162. data/man/ronin-update.1.md +14 -14
  163. data/man/ronin-urls.1.md +22 -22
  164. data/man/ronin-wordlist.1.md +14 -13
  165. data/man/ronin.1.md +1 -1
  166. data/spec/arch_spec.rb +59 -46
  167. data/spec/author_spec.rb +14 -14
  168. data/spec/campaign_spec.rb +8 -0
  169. data/spec/credential_spec.rb +11 -8
  170. data/spec/database_spec.rb +6 -6
  171. data/spec/email_address_spec.rb +23 -20
  172. data/spec/host_name_spec.rb +24 -22
  173. data/spec/installation_spec.rb +6 -6
  174. data/spec/ip_address_spec.rb +31 -26
  175. data/spec/license_spec.rb +15 -9
  176. data/spec/mac_address_spec.rb +17 -8
  177. data/spec/model/has_authors_spec.rb +56 -37
  178. data/spec/model/has_description_spec.rb +36 -23
  179. data/spec/model/has_license_spec.rb +38 -28
  180. data/spec/model/has_name_spec.rb +36 -19
  181. data/spec/model/has_title_spec.rb +27 -14
  182. data/spec/model/has_version_spec.rb +64 -35
  183. data/spec/model/model_spec.rb +57 -33
  184. data/spec/model/models/{basic_model.rb → base_model.rb} +1 -1
  185. data/spec/model/models/{custom_model.rb → inherited_model.rb} +2 -3
  186. data/spec/os_spec.rb +24 -20
  187. data/spec/password_spec.rb +17 -9
  188. data/spec/port_spec.rb +30 -22
  189. data/spec/repository_spec.rb +59 -60
  190. data/spec/ronin_spec.rb +4 -4
  191. data/spec/script/buildable_spec.rb +8 -8
  192. data/spec/script/deployable_spec.rb +7 -7
  193. data/spec/script/path_spec.rb +42 -40
  194. data/spec/script/script_spec.rb +23 -23
  195. data/spec/script/testable_spec.rb +20 -20
  196. data/spec/service_spec.rb +14 -8
  197. data/spec/software_spec.rb +30 -17
  198. data/spec/spec_helper.rb +4 -4
  199. data/spec/ui/cli/classes/test_command.rb +2 -4
  200. data/spec/ui/cli/cli_spec.rb +5 -5
  201. data/spec/ui/cli/command_spec.rb +34 -30
  202. data/spec/url_query_param_spec.rb +23 -14
  203. data/spec/url_scheme_spec.rb +12 -9
  204. data/spec/url_spec.rb +64 -61
  205. data/spec/vendor_spec.rb +15 -8
  206. metadata +122 -150
  207. data/.gemtest +0 -0
data/spec/port_spec.rb CHANGED
@@ -1,43 +1,51 @@
1
1
  require 'spec_helper'
2
+
2
3
  require 'ronin/port'
3
4
 
4
5
  describe Port do
5
6
  let(:protocol) { 'tcp' }
6
- let(:number) { 80 }
7
+ let(:number) { 80 }
7
8
 
8
- before(:all) do
9
- @port = Port.create(:protocol => protocol, :number => number)
9
+ subject do
10
+ described_class.new(:protocol => protocol, :number => number)
10
11
  end
11
12
 
12
- it "should require a protocol" do
13
- port = Port.new(:number => 1111)
13
+ before { subject.save }
14
14
 
15
- port.should_not be_valid
16
- end
15
+ describe "validations" do
16
+ it "should require a protocol" do
17
+ port = described_class.new(:number => port)
17
18
 
18
- it "should require a port number" do
19
- port = Port.new(:protocol => 'tcp')
19
+ expect(port).not_to be_valid
20
+ end
20
21
 
21
- port.should_not be_valid
22
- end
22
+ it "should require a port number" do
23
+ port = described_class.new(:protocol => protocol)
23
24
 
24
- it "should only allow 'tcp' and 'udp' as protocols" do
25
- port = Port.new(:protocol => 'foo', :number => 1111)
25
+ expect(port).not_to be_valid
26
+ end
26
27
 
27
- port.should_not be_valid
28
- end
28
+ it "should only allow 'tcp' and 'udp' as protocols" do
29
+ port = described_class.new(:protocol => 'foo', :number => port)
29
30
 
30
- it "should require unique protocol/port-number combinations" do
31
- port = Port.new(:protocol => protocol, :number => number)
31
+ expect(port).not_to be_valid
32
+ end
32
33
 
33
- port.should_not be_valid
34
+ it "should require unique protocol/port-number combinations" do
35
+ port = described_class.new(:protocol => protocol, :number => number)
36
+ expect(port).not_to be_valid
37
+ end
34
38
  end
35
39
 
36
- it "should be convertable to an Integer" do
37
- @port.to_i.should == number
40
+ describe "#to_i" do
41
+ it "should be convertable to an Integer" do
42
+ expect(subject.to_i).to eq(number)
43
+ end
38
44
  end
39
45
 
40
- it "should be convertable to a String" do
41
- @port.to_s.should == "#{number}/#{protocol}"
46
+ describe "#to_s" do
47
+ it "should include the number and protocol" do
48
+ expect(subject.to_s).to eq("#{number}/#{protocol}")
49
+ end
42
50
  end
43
51
  end
@@ -12,72 +12,72 @@ describe Repository do
12
12
  it "should be able to retrieve an Repository by name" do
13
13
  repo = subject.find('local')
14
14
 
15
- repo.name.should == 'local'
15
+ expect(repo.name).to eq('local')
16
16
  end
17
17
 
18
18
  it "should be able to retrieve an Repository by name and domain" do
19
19
  repo = subject.find('installed@github.com')
20
20
 
21
- repo.name.should == 'installed'
22
- repo.domain.should == 'github.com'
21
+ expect(repo.name).to eq('installed')
22
+ expect(repo.domain).to eq('github.com')
23
23
  end
24
24
 
25
25
  it "should raise RepositoryNotFound for unknown Repository names" do
26
- lambda {
26
+ expect {
27
27
  subject.find('bla')
28
- }.should raise_error(RepositoryNotFound)
28
+ }.to raise_error(RepositoryNotFound)
29
29
  end
30
30
 
31
31
  it "should raise RepositoryNotFound for unknown Repository names or domains" do
32
- lambda {
32
+ expect {
33
33
  subject.find('bla/bla')
34
- }.should raise_error(RepositoryNotFound)
34
+ }.to raise_error(RepositoryNotFound)
35
35
  end
36
36
  end
37
37
 
38
38
  describe "add" do
39
39
  it "should not add Repositorys without a path property" do
40
- lambda {
40
+ expect {
41
41
  subject.add
42
- }.should raise_error(ArgumentError)
42
+ }.to raise_error(ArgumentError)
43
43
  end
44
44
 
45
45
  it "should not add Repositorys that do not point to a directory" do
46
- lambda {
46
+ expect {
47
47
  subject.add(:path => 'path/to/nowhere')
48
- }.should raise_error(RepositoryNotFound)
48
+ }.to raise_error(RepositoryNotFound)
49
49
  end
50
50
 
51
51
  it "should not allow adding an Repository from the same path twice" do
52
- lambda {
52
+ expect {
53
53
  subject.add(:path => repository('local').path)
54
- }.should raise_error(DuplicateRepository)
54
+ }.to raise_error(DuplicateRepository)
55
55
  end
56
56
 
57
57
  it "should not allow adding an Repository that was already installed" do
58
- lambda {
58
+ expect {
59
59
  subject.add(:path => repository('installed').path)
60
- }.should raise_error(DuplicateRepository)
60
+ }.to raise_error(DuplicateRepository)
61
61
  end
62
62
  end
63
63
 
64
64
  describe "install" do
65
65
  it "should not allow installing an Repository with no URI" do
66
- lambda {
66
+ expect {
67
67
  subject.install
68
- }.should raise_error(ArgumentError)
68
+ }.to raise_error(ArgumentError)
69
69
  end
70
70
 
71
71
  it "should not allow installing an Repository that was already added" do
72
- lambda {
72
+ expect {
73
73
  subject.install(:uri => repository('remote').uri)
74
- }.should raise_error(DuplicateRepository)
74
+ }.to raise_error(DuplicateRepository)
75
75
  end
76
76
 
77
77
  it "should not allow installing an Repository from the same URI twice" do
78
- lambda {
78
+ expect {
79
79
  subject.install(:uri => repository('installed').uri)
80
- }.should raise_error(DuplicateRepository)
80
+ }.to raise_error(DuplicateRepository)
81
81
  end
82
82
  end
83
83
 
@@ -85,15 +85,15 @@ describe Repository do
85
85
  it "should be considered local for 'localhost' domains" do
86
86
  repo = repository('local')
87
87
 
88
- repo.should be_local
89
- repo.should_not be_remote
88
+ expect(repo).to be_local
89
+ expect(repo).not_to be_remote
90
90
  end
91
91
 
92
92
  it "should be considered remote for non 'localhost' domains" do
93
93
  repo = repository('installed')
94
94
 
95
- repo.should be_remote
96
- repo.should_not be_local
95
+ expect(repo).to be_remote
96
+ expect(repo).not_to be_local
97
97
  end
98
98
  end
99
99
 
@@ -103,7 +103,7 @@ describe Repository do
103
103
  :path => File.join(Helpers::Repositories::DIR,'local')
104
104
  )
105
105
 
106
- repo.name.should == 'local'
106
+ expect(repo.name).to eq('local')
107
107
  end
108
108
 
109
109
  it "should default the 'installed' property to false" do
@@ -112,7 +112,7 @@ describe Repository do
112
112
  :uri => 'git://github.com/path/to/local.git'
113
113
  )
114
114
 
115
- repo.installed.should == false
115
+ expect(repo.installed).to be(false)
116
116
  end
117
117
  end
118
118
 
@@ -120,18 +120,18 @@ describe Repository do
120
120
  subject { repository('installed') }
121
121
 
122
122
  it "should load the title" do
123
- subject.title.should == 'Installed Repo'
123
+ expect(subject.title).to eq('Installed Repo')
124
124
  end
125
125
 
126
126
  it "should load the website" do
127
127
  website = Addressable::URI.parse('http://ronin.rubyforge.org/')
128
128
 
129
- subject.website.should == website
129
+ expect(subject.website).to eq(website)
130
130
  end
131
131
 
132
132
  it "should load the license" do
133
- subject.license.should_not be_nil
134
- subject.license.name.should == 'GPL-2'
133
+ expect(subject.license).not_to be_nil
134
+ expect(subject.license.name).to eq('GPL-2')
135
135
  end
136
136
 
137
137
  it "should load the maintainers" do
@@ -140,41 +140,42 @@ describe Repository do
140
140
  author.email == 'postmodern.mod3@gmail.com'
141
141
  }
142
142
 
143
- author.should_not be_nil
143
+ expect(author).not_to be_nil
144
144
  end
145
145
 
146
146
  it "should load the description" do
147
- subject.description.should == %{This is a test repo used in Ronin's specs.}
147
+ expect(subject.description).to eq(%{This is a test repo used in Ronin's specs.})
148
148
  end
149
149
  end
150
150
 
151
151
  describe "#activate!" do
152
152
  subject { repository('local') }
153
153
 
154
- before(:all) do
155
- subject.activate!
156
- end
154
+ before { subject.activate! }
157
155
 
158
156
  it "should load the init.rb file if present" do
159
- $local_repo_loaded.should == true
157
+ expect($local_repo_loaded).to be(true)
160
158
  end
161
159
 
162
160
  it "should make the lib directory accessible to Kernel#require" do
163
- require('stuff/test').should == true
161
+ expect(require('stuff/test')).to be(true)
164
162
  end
163
+
164
+ after { subject.deactivate! }
165
165
  end
166
166
 
167
167
  describe "#deactivate!" do
168
168
  subject { repository('local') }
169
169
 
170
- before(:all) do
170
+ before do
171
+ subject.activate!
171
172
  subject.deactivate!
172
173
  end
173
174
 
174
175
  it "should make the lib directory unaccessible to Kernel#require" do
175
- lambda {
176
+ expect {
176
177
  require 'stuff/another_test'
177
- }.should raise_error(LoadError)
178
+ }.to raise_error(LoadError)
178
179
  end
179
180
  end
180
181
 
@@ -182,13 +183,13 @@ describe Repository do
182
183
  subject { repository('scripts') }
183
184
 
184
185
  it "should list the contents of the 'cache/' directory" do
185
- subject.each_script.to_a.should_not be_empty
186
+ expect(subject.each_script.to_a).not_to be_empty
186
187
  end
187
188
 
188
189
  it "should only list '.rb' files" do
189
- subject.each_script.map { |path|
190
+ expect(subject.each_script.map { |path|
190
191
  path.extname
191
- }.uniq.should == ['.rb']
192
+ }.uniq).to eq(['.rb'])
192
193
  end
193
194
  end
194
195
 
@@ -196,44 +197,44 @@ describe Repository do
196
197
  subject { repository('scripts') }
197
198
 
198
199
  describe "#cache_scripts!" do
199
- before(:all) { subject.cache_scripts! }
200
+ before { subject.cache_scripts! }
200
201
 
201
202
  it "should be populated script_paths" do
202
- subject.script_paths.should_not be_empty
203
+ expect(subject.script_paths).not_to be_empty
203
204
  end
204
205
 
205
206
  it "should recover from files that contain syntax errors" do
206
- subject.find_script('failures/syntax_errors.rb').should_not be_nil
207
+ expect(subject.find_script('failures/syntax_errors.rb')).not_to be_nil
207
208
  end
208
209
 
209
210
  it "should recover from files that raised exceptions" do
210
- subject.find_script('failures/exceptions.rb').should_not be_nil
211
+ expect(subject.find_script('failures/exceptions.rb')).not_to be_nil
211
212
  end
212
213
 
213
214
  it "should recover from files that raise NoMethodError" do
214
- subject.find_script('failures/no_method_errors.rb').should_not be_nil
215
+ expect(subject.find_script('failures/no_method_errors.rb')).not_to be_nil
215
216
  end
216
217
 
217
218
  it "should recover from files that have validation errors" do
218
- subject.find_script('failures/validation_errors.rb').should_not be_nil
219
+ expect(subject.find_script('failures/validation_errors.rb')).not_to be_nil
219
220
  end
220
221
 
221
222
  it "should clear script_paths before re-populate them" do
222
223
  paths = subject.script_paths.length
223
224
  subject.cache_scripts!
224
225
 
225
- subject.script_paths.length.should == paths
226
+ expect(subject.script_paths.length).to eq(paths)
226
227
  end
227
228
 
228
229
  it "should be populated using the paths in the 'cache/' directory" do
229
- subject.script_paths.map { |file|
230
+ expect(subject.script_paths.map { |file|
230
231
  file.path
231
- }.should == subject.each_script.to_a
232
+ }).to eq(subject.each_script.to_a)
232
233
  end
233
234
  end
234
235
 
235
236
  describe "#sync_scripts!" do
236
- before(:all) do
237
+ before do
237
238
  subject.cache_scripts!
238
239
 
239
240
  script_path = subject.find_script('cached/modified.rb')
@@ -250,21 +251,19 @@ describe Repository do
250
251
  it "should update stale cached files" do
251
252
  script_path = subject.find_script('cached/modified.rb')
252
253
 
253
- script_path.timestamp.should == File.mtime(script_path.path)
254
+ expect(script_path.timestamp).to eq(File.mtime(script_path.path))
254
255
  end
255
256
 
256
257
  it "should cache new files" do
257
- subject.find_script('cached/cached.rb').should_not be_nil
258
+ expect(subject.find_script('cached/cached.rb')).not_to be_nil
258
259
  end
259
260
  end
260
261
 
261
262
  describe "#clean_scripts!" do
262
- before(:all) do
263
- subject.clean_scripts!
264
- end
263
+ before { subject.clean_scripts! }
265
264
 
266
265
  it "should clear the script_paths" do
267
- subject.script_paths.should be_empty
266
+ expect(subject.script_paths).to be_empty
268
267
  end
269
268
  end
270
269
  end
data/spec/ronin_spec.rb CHANGED
@@ -6,12 +6,12 @@ describe Ronin do
6
6
  it "should have a version" do
7
7
  version = subject.const_get('VERSION')
8
8
 
9
- version.should_not be_nil
10
- version.should_not be_empty
9
+ expect(version).not_to be_nil
10
+ expect(version).not_to be_empty
11
11
  end
12
12
 
13
13
  it "should include AutoLoad" do
14
- subject.should include(AutoLoad)
14
+ expect(subject).to include(AutoLoad)
15
15
  end
16
16
 
17
17
  it "should add a const_missing method when included" do
@@ -20,6 +20,6 @@ describe Ronin do
20
20
 
21
21
  subject.const_set('SOME_CONSTANT',1)
22
22
 
23
- base_class.const_get('SOME_CONSTANT').should == 1
23
+ expect(base_class.const_get('SOME_CONSTANT')).to eq(1)
24
24
  end
25
25
  end
@@ -13,39 +13,39 @@ describe Script::Buildable do
13
13
  end
14
14
 
15
15
  it "should not be built by default" do
16
- subject.should_not be_built
16
+ expect(subject).not_to be_built
17
17
  end
18
18
 
19
19
  it "should include Testable" do
20
- subject.class.included_modules.should include(Script::Testable)
20
+ expect(subject.class.included_modules).to include(Script::Testable)
21
21
  end
22
22
 
23
23
  describe "#build!" do
24
24
  it "should call the build block" do
25
25
  subject.build!
26
26
 
27
- subject.output.should == "hello world"
27
+ expect(subject.output).to eq("hello world")
28
28
  end
29
29
 
30
30
  it "should mark the script as built" do
31
31
  subject.build!
32
32
 
33
- subject.should be_built
33
+ expect(subject).to be_built
34
34
  end
35
35
 
36
36
  it "should accept parameters as options" do
37
37
  subject.build!(:var => 'dave')
38
38
 
39
- subject.output.should == "hello dave"
40
- subject.var.should == 'dave'
39
+ expect(subject.output).to eq("hello dave")
40
+ expect(subject.var).to eq('dave')
41
41
  end
42
42
  end
43
43
 
44
44
  describe "#verify!" do
45
45
  it "should raise a NotBuilt exception when verifying unbuilt scripts" do
46
- lambda {
46
+ expect {
47
47
  subject.test!
48
- }.should raise_error(Script::NotBuilt)
48
+ }.to raise_error(Script::NotBuilt)
49
49
  end
50
50
  end
51
51
  end
@@ -16,32 +16,32 @@ describe Script::Deployable do
16
16
  end
17
17
 
18
18
  it "should include Testable" do
19
- subject.class.included_modules.should include(Script::Testable)
19
+ expect(subject.class.included_modules).to include(Script::Testable)
20
20
  end
21
21
 
22
22
  it "should not be deployed by default" do
23
- subject.should_not be_deployed
23
+ expect(subject).not_to be_deployed
24
24
  end
25
25
 
26
26
  describe "#deploy!" do
27
27
  it "should test! the script before deploying it" do
28
28
  subject.var = -1
29
29
 
30
- lambda {
30
+ expect {
31
31
  subject.deploy!
32
- }.should raise_error
32
+ }.to raise_error(RuntimeError)
33
33
  end
34
34
 
35
35
  it "should mark the script deployed" do
36
36
  subject.deploy!
37
37
 
38
- subject.should be_deployed
38
+ expect(subject).to be_deployed
39
39
  end
40
40
 
41
41
  it "should not mark the script as evacuated" do
42
42
  subject.deploy!
43
43
 
44
- subject.should_not be_evacuated
44
+ expect(subject).not_to be_evacuated
45
45
  end
46
46
  end
47
47
 
@@ -49,7 +49,7 @@ describe Script::Deployable do
49
49
  it "should mark the script as evacuated" do
50
50
  subject.evacuate!
51
51
 
52
- subject.should be_evacuated
52
+ expect(subject).to be_evacuated
53
53
  end
54
54
  end
55
55
  end