summaryrefslogtreecommitdiff
path: root/spec/ruby/library/openssl/random
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/openssl/random')
-rw-r--r--spec/ruby/library/openssl/random/pseudo_bytes_spec.rb4
-rw-r--r--spec/ruby/library/openssl/random/random_bytes_spec.rb4
-rw-r--r--spec/ruby/library/openssl/random/shared/random_bytes.rb10
3 files changed, 9 insertions, 9 deletions
diff --git a/spec/ruby/library/openssl/random/pseudo_bytes_spec.rb b/spec/ruby/library/openssl/random/pseudo_bytes_spec.rb
index 83c8cc13c8..c5e450ce3d 100644
--- a/spec/ruby/library/openssl/random/pseudo_bytes_spec.rb
+++ b/spec/ruby/library/openssl/random/pseudo_bytes_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../shared/random_bytes.rb', __FILE__)
+require_relative '../../../spec_helper'
+require_relative 'shared/random_bytes'
if defined?(OpenSSL::Random.pseudo_bytes)
describe "OpenSSL::Random.pseudo_bytes" do
diff --git a/spec/ruby/library/openssl/random/random_bytes_spec.rb b/spec/ruby/library/openssl/random/random_bytes_spec.rb
index b8bd209eb0..2678885da4 100644
--- a/spec/ruby/library/openssl/random/random_bytes_spec.rb
+++ b/spec/ruby/library/openssl/random/random_bytes_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../shared/random_bytes.rb', __FILE__)
+require_relative '../../../spec_helper'
+require_relative 'shared/random_bytes'
describe "OpenSSL::Random.random_bytes" do
it_behaves_like :openssl_random_bytes, :random_bytes
diff --git a/spec/ruby/library/openssl/random/shared/random_bytes.rb b/spec/ruby/library/openssl/random/shared/random_bytes.rb
index 399e40de39..4d1751e57e 100644
--- a/spec/ruby/library/openssl/random/shared/random_bytes.rb
+++ b/spec/ruby/library/openssl/random/shared/random_bytes.rb
@@ -1,11 +1,11 @@
-require File.expand_path('../../../../../spec_helper', __FILE__)
+require_relative '../../../../spec_helper'
require 'openssl'
-describe :openssl_random_bytes, shared: true do |cmd|
+describe :openssl_random_bytes, shared: true do
it "generates a random binary string of specified length" do
(1..64).each do |idx|
bytes = OpenSSL::Random.send(@method, idx)
- bytes.should be_kind_of(String)
+ bytes.should.is_a?(String)
bytes.length.should == idx
end
end
@@ -22,8 +22,8 @@ describe :openssl_random_bytes, shared: true do |cmd|
end
it "raises ArgumentError on negative arguments" do
- lambda {
+ -> {
OpenSSL::Random.send(@method, -1)
- }.should raise_error(ArgumentError)
+ }.should.raise(ArgumentError)
end
end