diff options
Diffstat (limited to 'spec/ruby/core/dir/read_spec.rb')
| -rw-r--r-- | spec/ruby/core/dir/read_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/ruby/core/dir/read_spec.rb b/spec/ruby/core/dir/read_spec.rb index 2953aad72f..3f842457f4 100644 --- a/spec/ruby/core/dir/read_spec.rb +++ b/spec/ruby/core/dir/read_spec.rb @@ -15,7 +15,7 @@ describe "Dir#read" do # an FS does not necessarily impose order ls = Dir.entries DirSpecs.mock_dir dir = Dir.open DirSpecs.mock_dir - ls.should include(dir.read) + ls.should.include?(dir.read) dir.close end @@ -54,16 +54,16 @@ describe "Dir#read" do old_external_encoding = Encoding::default_external Encoding.default_internal = Encoding::UTF_8 Encoding.default_external = Encoding::SHIFT_JIS - dir = Dir.open(File.join(DirSpecs.mock_dir, 'special')) shift_jis_entries = [] begin - -> { - while entry = dir.read - shift_jis_entries << entry - end - }.should_not raise_error + Dir.open(File.join(DirSpecs.mock_dir, 'special')) do |d| + -> { + while entry = d.read + shift_jis_entries << entry + end + }.should_not.raise + end ensure - dir.close Encoding.default_internal = old_internal_encoding Encoding.default_external = old_external_encoding end |
