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.
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
@@ -10,73 +10,73 @@ describe Script::Path do
10
10
  let(:repo) { repository('scripts') }
11
11
  let(:script_class) { MyScript }
12
12
 
13
- before(:all) { repo.cache_scripts! }
13
+ before { repo.cache_scripts! }
14
14
 
15
15
  describe "cached file" do
16
16
  subject { repo.find_script('cached/cached.rb') }
17
17
 
18
18
  it "should be saved" do
19
- subject.should be_saved
19
+ expect(subject).to be_saved
20
20
  end
21
21
 
22
22
  it "should have a path" do
23
- subject.path.should_not be_nil
23
+ expect(subject.path).not_to be_nil
24
24
  end
25
25
 
26
26
  it "should have a timestamp" do
27
- subject.timestamp.should_not be_nil
27
+ expect(subject.timestamp).not_to be_nil
28
28
  end
29
29
 
30
30
  it "should not have updated code" do
31
- subject.should_not be_updated
31
+ expect(subject).not_to be_updated
32
32
  end
33
33
 
34
34
  it "should not have cache exceptions" do
35
- subject.cache_exception.should be_nil
35
+ expect(subject.cache_exception).to be_nil
36
36
  end
37
37
 
38
38
  it "should not have cache errors" do
39
- subject.cache_errors.should be_nil
39
+ expect(subject.cache_errors).to be_nil
40
40
  end
41
41
 
42
42
  it "should have the model name of the cached object" do
43
- subject.class_name.should == script_class.name
43
+ expect(subject.class_name).to eq(script_class.name)
44
44
  end
45
45
 
46
46
  it "should have the model path of the cached object" do
47
- subject.class_path.should == 'my_script'
47
+ expect(subject.class_path).to eq('my_script')
48
48
  end
49
49
 
50
50
  it "should be able to load the Model of the cached object" do
51
- subject.script_class.should == script_class
51
+ expect(subject.script_class).to eq(script_class)
52
52
  end
53
53
 
54
54
  it "should be able to load a fresh model from the cached file" do
55
55
  obj = subject.load_script
56
56
 
57
- obj.should_not be_nil
58
- obj.class.should == script_class
57
+ expect(obj).not_to be_nil
58
+ expect(obj.class).to eq(script_class)
59
59
  end
60
60
 
61
61
  it "should cache the loaded object along with the cached file" do
62
62
  obj = script_class.first(:script_path => subject)
63
63
 
64
- obj.should_not be_nil
64
+ expect(obj).not_to be_nil
65
65
  end
66
66
 
67
67
  it "should be able to load the cached object" do
68
- subject.cached_script.should_not be_nil
69
- subject.cached_script.class.should == script_class
68
+ expect(subject.cached_script).not_to be_nil
69
+ expect(subject.cached_script.class).to eq(script_class)
70
70
  end
71
71
 
72
72
  it "should call the cache method before saving the new object" do
73
- subject.cached_script.name.should == 'cached'
73
+ expect(subject.cached_script.name).to eq('cached')
74
74
  end
75
75
 
76
76
  it "should delete the cached object along with the cached file" do
77
77
  subject.destroy
78
78
 
79
- script_class.first(:script_path => subject).should be_nil
79
+ expect(script_class.first(:script_path => subject)).to be_nil
80
80
  end
81
81
  end
82
82
 
@@ -89,41 +89,43 @@ describe Script::Path do
89
89
  let(:validation_error) { repo.find_script('failures/validation_errors.rb') }
90
90
 
91
91
  it "should not save new cached files that raised exceptions" do
92
- syntax_error.should_not be_saved
93
- load_error.should_not be_saved
94
- exception.should_not be_saved
92
+ expect(syntax_error).not_to be_saved
93
+ expect(load_error).not_to be_saved
94
+ expect(exception).not_to be_saved
95
95
  end
96
96
 
97
- it "should not save new cached files that contain validation errors" do
98
- validation_error.should_not be_saved
97
+ pending "https://github.com/ronin-rb/ronin/issues/7" do
98
+ it "should not save new cached files that contain validation errors" do
99
+ expect(validation_error).to_not be_saved
100
+ end
99
101
  end
100
102
 
101
103
  it "should store syntax errors" do
102
- syntax_error.cache_exception.should_not be_nil
103
- syntax_error.cache_exception.class.should == SyntaxError
104
+ expect(syntax_error.cache_exception).not_to be_nil
105
+ expect(syntax_error.cache_exception.class).to eq(SyntaxError)
104
106
  end
105
107
 
106
108
  it "should store LoadError exceptions" do
107
- load_error.cache_exception.should_not be_nil
108
- load_error.cache_exception.class.should == LoadError
109
+ expect(load_error.cache_exception).not_to be_nil
110
+ expect(load_error.cache_exception.class).to eq(LoadError)
109
111
  end
110
112
 
111
113
  it "should store NameError exceptions" do
112
- name_error.cache_exception.should_not be_nil
113
- name_error.cache_exception.class.should == NameError
114
+ expect(name_error.cache_exception).not_to be_nil
115
+ expect(name_error.cache_exception.class).to eq(NameError)
114
116
  end
115
117
 
116
118
  it "should store NoMethodError exceptions" do
117
- no_method_error.cache_exception.should_not be_nil
118
- no_method_error.cache_exception.class.should == NoMethodError
119
+ expect(no_method_error.cache_exception).not_to be_nil
120
+ expect(no_method_error.cache_exception.class).to eq(NoMethodError)
119
121
  end
120
122
 
121
123
  it "should store Exceptions raised when creating the fresh object" do
122
- exception.cache_exception.should_not be_nil
124
+ expect(exception.cache_exception).not_to be_nil
123
125
  end
124
126
 
125
127
  it "should store validation errors" do
126
- validation_error.cache_errors.should_not be_nil
128
+ expect(validation_error.cache_errors).not_to be_nil
127
129
  end
128
130
  end
129
131
 
@@ -135,18 +137,18 @@ describe Script::Path do
135
137
  end
136
138
 
137
139
  it "should not re-cache unmodified files" do
138
- subject.sync.should == false
140
+ expect(subject.sync).to be(false)
139
141
  end
140
142
 
141
143
  it "should not have cache errors" do
142
- subject.cache_errors.should be_nil
144
+ expect(subject.cache_errors).to be_nil
143
145
  end
144
146
  end
145
147
 
146
148
  describe "modified cached file" do
147
149
  subject { repo.find_script('cached/modified.rb') }
148
150
 
149
- before(:all) do
151
+ before do
150
152
  subject.update(:timestamp => (subject.timestamp - 10))
151
153
  end
152
154
 
@@ -155,29 +157,29 @@ describe Script::Path do
155
157
  end
156
158
 
157
159
  it "should re-cache modified files" do
158
- subject.sync.should == true
160
+ expect(subject.sync).to be(true)
159
161
  end
160
162
 
161
163
  it "should not have cache errors" do
162
- subject.cache_errors.should be_nil
164
+ expect(subject.cache_errors).to be_nil
163
165
  end
164
166
  end
165
167
 
166
168
  describe "missing cached file" do
167
169
  subject { repo.find_script('cached/missing.rb') }
168
170
 
169
- before(:all) do
171
+ before do
170
172
  subject.update(:path => File.join('','missing','file.rb'))
171
173
 
172
174
  subject.sync
173
175
  end
174
176
 
175
177
  it "should delete the cached files" do
176
- described_class.count(:id => subject.id).should == 0
178
+ expect(described_class.count(:id => subject.id)).to eq(0)
177
179
  end
178
180
 
179
181
  it "should delete cached objects for missing files" do
180
- script_class.count(:script_path => subject).should == 0
182
+ expect(script_class.count(:script_path => subject)).to eq(0)
181
183
  end
182
184
  end
183
185
  end
@@ -11,70 +11,70 @@ describe Script do
11
11
 
12
12
  let(:repo) { repository('scripts') }
13
13
 
14
- before(:all) { repo.cache_scripts! }
14
+ before { repo.cache_scripts! }
15
15
 
16
16
  it "should be a Model" do
17
- subject.included_modules.should include(Model)
17
+ expect(subject.included_modules).to include(Model)
18
18
  end
19
19
 
20
20
  it "should have a name" do
21
- subject.included_modules.should include(Model::HasName)
21
+ expect(subject.included_modules).to include(Model::HasName)
22
22
  end
23
23
 
24
24
  it "should have a description" do
25
- subject.included_modules.should include(Model::HasDescription)
25
+ expect(subject.included_modules).to include(Model::HasDescription)
26
26
  end
27
27
 
28
28
  it "should have a version" do
29
- subject.included_modules.should include(Model::HasVersion)
29
+ expect(subject.included_modules).to include(Model::HasVersion)
30
30
  end
31
31
 
32
32
  it "should include ObjectLoader" do
33
- subject.included_modules.should include(ObjectLoader)
33
+ expect(subject.included_modules).to include(ObjectLoader)
34
34
  end
35
35
 
36
36
  it "should include DataPaths::Finders" do
37
- subject.included_modules.should include(DataPaths::Finders)
37
+ expect(subject.included_modules).to include(DataPaths::Finders)
38
38
  end
39
39
 
40
40
  it "should include Parameters" do
41
- subject.included_modules.should include(Parameters)
41
+ expect(subject.included_modules).to include(Parameters)
42
42
  end
43
43
 
44
44
  it "should include UI::Output::Helpers" do
45
- subject.included_modules.should include(UI::Output::Helpers)
45
+ expect(subject.included_modules).to include(UI::Output::Helpers)
46
46
  end
47
47
 
48
48
  it "should add the type property to the model" do
49
- subject.properties.should be_named(:type)
49
+ expect(subject.properties).to be_named(:type)
50
50
  end
51
51
 
52
52
  it "should add a relation between Script::Path and the script" do
53
- subject.relationships.should be_named(:script_path)
53
+ expect(subject.relationships).to be_named(:script_path)
54
54
  end
55
55
 
56
56
  describe "#initialize" do
57
57
  it "should initialize attributes" do
58
58
  resource = subject.new(:name => 'test')
59
59
 
60
- resource.name.should == 'test'
60
+ expect(resource.name).to eq('test')
61
61
  end
62
62
 
63
63
  it "should initialize parameters" do
64
64
  resource = subject.new(:x => 5)
65
65
 
66
- resource.x.should == 5
66
+ expect(resource.x).to eq(5)
67
67
  end
68
68
 
69
69
  it "should allow custom initialize methods" do
70
70
  resource = subject.new
71
71
 
72
- resource.var.should == 2
72
+ expect(resource.var).to eq(2)
73
73
  end
74
74
  end
75
75
 
76
76
  it "should have an short-name" do
77
- subject.short_name.should == 'MyScript'
77
+ expect(subject.short_name).to eq('MyScript')
78
78
  end
79
79
 
80
80
  describe "load_from" do
@@ -83,23 +83,23 @@ describe Script do
83
83
  subject { Script.load_from(path) }
84
84
 
85
85
  it "should have a script_path resource" do
86
- subject.script_path.should_not be_nil
86
+ expect(subject.script_path).not_to be_nil
87
87
  end
88
88
 
89
89
  it "should prepare the object to be cached" do
90
- subject.content.should == 'this is a test'
90
+ expect(subject.content).to eq('this is a test')
91
91
  end
92
92
 
93
93
  it "should preserve instance variables" do
94
- subject.var.should == 2
94
+ expect(subject.var).to eq(2)
95
95
  end
96
96
 
97
97
  it "should preserve instance methods" do
98
- subject.greeting.should == 'hello'
98
+ expect(subject.greeting).to eq('hello')
99
99
  end
100
100
 
101
101
  it "should load the script source" do
102
- subject.should be_script_loaded
102
+ expect(subject).to be_script_loaded
103
103
  end
104
104
  end
105
105
 
@@ -107,13 +107,13 @@ describe Script do
107
107
  subject { MyScript.first(:name => 'test') }
108
108
 
109
109
  it "should have a cached_file resource" do
110
- subject.script_path.should_not be_nil
110
+ expect(subject.script_path).not_to be_nil
111
111
  end
112
112
 
113
113
  it "should be able to load the script source" do
114
114
  subject.load_script!
115
115
 
116
- subject.greeting.should == 'hello'
116
+ expect(subject.greeting).to eq('hello')
117
117
  end
118
118
 
119
119
  it "should only load the script source once" do
@@ -122,7 +122,7 @@ describe Script do
122
122
  subject.var = false
123
123
  subject.load_script!
124
124
 
125
- subject.var.should == false
125
+ expect(subject.var).to be(false)
126
126
  end
127
127
  end
128
128
  end
@@ -17,10 +17,10 @@ describe Script::Testable do
17
17
  end
18
18
 
19
19
  obj.var = 20
20
- lambda { obj.test! }.should raise_error(Script::TestFailed)
20
+ expect { obj.test! }.to raise_error(Script::TestFailed)
21
21
 
22
22
  obj.var = 4
23
- obj.test!.should == true
23
+ expect(obj.test!).to be(true)
24
24
  end
25
25
 
26
26
  it "should test an expression is true" do
@@ -31,87 +31,87 @@ describe Script::Testable do
31
31
  end
32
32
 
33
33
  obj.var = 1
34
- lambda { obj.test! }.should raise_error(Script::TestFailed)
34
+ expect { obj.test! }.to raise_error(Script::TestFailed)
35
35
 
36
36
  obj.var = 2
37
- obj.test!.should == true
37
+ expect(obj.test!).to be(true)
38
38
  end
39
39
 
40
40
  it "should test a method returns an expected value" do
41
41
  obj = subject.new { test_equal :var, 5 }
42
42
 
43
- lambda { obj.test! }.should raise_error(Script::TestFailed)
43
+ expect { obj.test! }.to raise_error(Script::TestFailed)
44
44
 
45
45
  obj.var = 5
46
- obj.test!.should == true
46
+ expect(obj.test!).to be(true)
47
47
  end
48
48
 
49
49
  it "should test a method does not return an expected value" do
50
50
  obj = subject.new { test_not_equal :var, 5 }
51
51
 
52
52
  obj.var = 5
53
- lambda { obj.test! }.should raise_error(Script::TestFailed)
53
+ expect { obj.test! }.to raise_error(Script::TestFailed)
54
54
 
55
55
  obj.var = 2
56
- obj.test!.should == true
56
+ expect(obj.test!).to be(true)
57
57
  end
58
58
 
59
59
  it "should test a method returns a non-nil value" do
60
60
  obj = subject.new { test_set :var }
61
61
 
62
- lambda { obj.test! }.should raise_error(Script::TestFailed)
62
+ expect { obj.test! }.to raise_error(Script::TestFailed)
63
63
 
64
64
  obj.var = 2
65
- obj.test!.should == true
65
+ expect(obj.test!).to be(true)
66
66
  end
67
67
 
68
68
  it "should test a method returns a non-empty value" do
69
69
  obj = subject.new { test_set :var }
70
70
 
71
71
  obj.var = ''
72
- lambda { obj.test! }.should raise_error(Script::TestFailed)
72
+ expect { obj.test! }.to raise_error(Script::TestFailed)
73
73
 
74
74
  obj.var = 'hello'
75
- obj.test!.should == true
75
+ expect(obj.test!).to be(true)
76
76
  end
77
77
 
78
78
  it "should test a method matches a pattern" do
79
79
  obj = subject.new { test_match :var, /lo/ }
80
80
 
81
81
  obj.var = 'goodbye'
82
- lambda { obj.test! }.should raise_error(Script::TestFailed)
82
+ expect { obj.test! }.to raise_error(Script::TestFailed)
83
83
 
84
84
  obj.var = 'hello'
85
- obj.test!.should == true
85
+ expect(obj.test!).to be(true)
86
86
  end
87
87
 
88
88
  it "should test a method does not match a pattern" do
89
89
  obj = subject.new { test_no_match :var, /lo/ }
90
90
 
91
91
  obj.var = 'hello'
92
- lambda { obj.test! }.should raise_error(Script::TestFailed)
92
+ expect { obj.test! }.to raise_error(Script::TestFailed)
93
93
 
94
94
  obj.var = 'goodbye'
95
- obj.test!.should == true
95
+ expect(obj.test!).to be(true)
96
96
  end
97
97
 
98
98
  it "should test a method returns a value in a set of values" do
99
99
  obj = subject.new { test_in :var, [0, 2, 4, 8] }
100
100
 
101
101
  obj.var = 3
102
- lambda { obj.test! }.should raise_error(Script::TestFailed)
102
+ expect { obj.test! }.to raise_error(Script::TestFailed)
103
103
 
104
104
  obj.var = 2
105
- obj.test!.should == true
105
+ expect(obj.test!).to be(true)
106
106
  end
107
107
 
108
108
  it "should test a method returns a value not in a set of values" do
109
109
  obj = subject.new { test_not_in :var, [0, 2, 4, 8] }
110
110
 
111
111
  obj.var = 2
112
- lambda { obj.test! }.should raise_error(Script::TestFailed)
112
+ expect { obj.test! }.to raise_error(Script::TestFailed)
113
113
 
114
114
  obj.var = 3
115
- obj.test!.should == true
115
+ expect(obj.test!).to be(true)
116
116
  end
117
117
  end