diff options
Diffstat (limited to 'spec/ruby/library')
-rw-r--r-- | spec/ruby/library/logger/device/new_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/logger/logger/new_spec.rb | 6 | ||||
-rw-r--r-- | spec/ruby/library/rbconfig/rbconfig_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/library/rubygems/gem/bin_path_spec.rb | 15 | ||||
-rw-r--r-- | spec/ruby/library/tempfile/close_spec.rb | 6 | ||||
-rw-r--r-- | spec/ruby/library/tempfile/initialize_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/tempfile/shared/unlink.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/tmpdir/dir/mktmpdir_spec.rb | 2 |
8 files changed, 18 insertions, 21 deletions
diff --git a/spec/ruby/library/logger/device/new_spec.rb b/spec/ruby/library/logger/device/new_spec.rb index 2002e6f68e..26a38c2b8c 100644 --- a/spec/ruby/library/logger/device/new_spec.rb +++ b/spec/ruby/library/logger/device/new_spec.rb @@ -31,7 +31,7 @@ describe "Logger::LogDevice#new" do l.write("Test message") l.close - File.exist?(path).should be_true + File.should.exist?(path) File.open(path) do |f| f.readlines.should_not be_empty end diff --git a/spec/ruby/library/logger/logger/new_spec.rb b/spec/ruby/library/logger/logger/new_spec.rb index f70e1904f3..d3100ee2d1 100644 --- a/spec/ruby/library/logger/logger/new_spec.rb +++ b/spec/ruby/library/logger/logger/new_spec.rb @@ -46,8 +46,8 @@ describe "Logger#new" do l.add Logger::WARN, "foo" l.add Logger::WARN, "bar" - File.exist?(path).should be_true - File.exist?(path + ".0").should be_true + File.should.exist?(path) + File.should.exist?(path + ".0") # first line will be a comment so we'll have to skip it. f = File.open(path) @@ -108,7 +108,7 @@ describe "Logger#new" do shifted_path = "#{path}.#{now.strftime(shift_period_suffix)}" - File.exist?(shifted_path).should == true + File.should.exist?(shifted_path) logger.close diff --git a/spec/ruby/library/rbconfig/rbconfig_spec.rb b/spec/ruby/library/rbconfig/rbconfig_spec.rb index 6725de8289..7c3fbf6c58 100644 --- a/spec/ruby/library/rbconfig/rbconfig_spec.rb +++ b/spec/ruby/library/rbconfig/rbconfig_spec.rb @@ -14,13 +14,13 @@ describe 'RbConfig::CONFIG' do it "['rubylibdir'] returns the directory containing Ruby standard libraries" do rubylibdir = RbConfig::CONFIG['rubylibdir'] File.directory?(rubylibdir).should == true - File.exist?("#{rubylibdir}/fileutils.rb").should == true + File.should.exist?("#{rubylibdir}/fileutils.rb") end it "['archdir'] returns the directory containing standard libraries C extensions" do archdir = RbConfig::CONFIG['archdir'] File.directory?(archdir).should == true - File.exist?("#{archdir}/etc.#{RbConfig::CONFIG['DLEXT']}").should == true + File.should.exist?("#{archdir}/etc.#{RbConfig::CONFIG['DLEXT']}") end end end diff --git a/spec/ruby/library/rubygems/gem/bin_path_spec.rb b/spec/ruby/library/rubygems/gem/bin_path_spec.rb index 73509e9066..bfcc3fba89 100644 --- a/spec/ruby/library/rubygems/gem/bin_path_spec.rb +++ b/spec/ruby/library/rubygems/gem/bin_path_spec.rb @@ -20,16 +20,13 @@ describe "Gem.bin_path" do default_specifications_dir = Gem::Specification.default_specifications_dir end - if Dir.exist?(default_specifications_dir) - Gem::Specification.each_spec([default_specifications_dir]) do |spec| - spec.executables.each do |exe| - path = Gem.bin_path(spec.name, exe) - File.should.exist?(path) - end + skip "Could not find the default gemspecs" unless Dir.exist?(default_specifications_dir) + + Gem::Specification.each_spec([default_specifications_dir]) do |spec| + spec.executables.each do |exe| + path = Gem.bin_path(spec.name, exe) + File.should.exist?(path) end - else - # non-installed MRI, there are no default gemspecs - 1.should == 1 end end end diff --git a/spec/ruby/library/tempfile/close_spec.rb b/spec/ruby/library/tempfile/close_spec.rb index 6cd55beecf..db0eae3fa5 100644 --- a/spec/ruby/library/tempfile/close_spec.rb +++ b/spec/ruby/library/tempfile/close_spec.rb @@ -18,7 +18,7 @@ describe "Tempfile#close when passed no argument or [false]" do it "does not unlink self" do path = @tempfile.path @tempfile.close - File.exist?(path).should be_true + File.should.exist?(path) end end @@ -35,7 +35,7 @@ describe "Tempfile#close when passed [true]" do it "unlinks self" do path = @tempfile.path @tempfile.close(true) - File.exist?(path).should be_false + File.should_not.exist?(path) end end @@ -52,6 +52,6 @@ describe "Tempfile#close!" do it "unlinks self" do path = @tempfile.path @tempfile.close! - File.exist?(path).should be_false + File.should_not.exist?(path) end end diff --git a/spec/ruby/library/tempfile/initialize_spec.rb b/spec/ruby/library/tempfile/initialize_spec.rb index 3b20e8ad4b..f2e786d7d8 100644 --- a/spec/ruby/library/tempfile/initialize_spec.rb +++ b/spec/ruby/library/tempfile/initialize_spec.rb @@ -12,7 +12,7 @@ describe "Tempfile#initialize" do it "opens a new tempfile with the passed name in the passed directory" do @tempfile.send(:initialize, "basename", tmp("")) - File.exist?(@tempfile.path).should be_true + File.should.exist?(@tempfile.path) tmpdir = tmp("") path = @tempfile.path diff --git a/spec/ruby/library/tempfile/shared/unlink.rb b/spec/ruby/library/tempfile/shared/unlink.rb index 2b575fd391..e821228d70 100644 --- a/spec/ruby/library/tempfile/shared/unlink.rb +++ b/spec/ruby/library/tempfile/shared/unlink.rb @@ -7,6 +7,6 @@ describe :tempfile_unlink, shared: true do @tempfile.close path = @tempfile.path @tempfile.send(@method) - File.exist?(path).should be_false + File.should_not.exist?(path) end end diff --git a/spec/ruby/library/tmpdir/dir/mktmpdir_spec.rb b/spec/ruby/library/tmpdir/dir/mktmpdir_spec.rb index eab86818bd..8165c2d8a8 100644 --- a/spec/ruby/library/tmpdir/dir/mktmpdir_spec.rb +++ b/spec/ruby/library/tmpdir/dir/mktmpdir_spec.rb @@ -39,7 +39,7 @@ describe "Dir.mktmpdir when passed a block" do Dir.mktmpdir do |path| @tmpdir = path called = true - path.start_with?(@real_tmp_root).should be_true + path.should.start_with?(@real_tmp_root) end called.should be_true end |