diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-20 20:18:52 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-20 20:18:52 +0000 |
commit | 1d15d5f08032acf1b7bceacbb450d617ff6e0931 (patch) | |
tree | a3785a79899302bc149e4a6e72f624ac27dc1f10 /spec/ruby/library/zlib/gzipfile | |
parent | 75bfc6440d595bf339007f4fb280fd4d743e89c1 (diff) |
Move spec/rubyspec to spec/ruby for consistency
* Other ruby implementations use the spec/ruby directory.
[Misc #13792] [ruby-core:82287]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/library/zlib/gzipfile')
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/close_spec.rb | 22 | ||||
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/closed_spec.rb | 17 | ||||
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/comment_spec.rb | 27 | ||||
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/crc_spec.rb | 1 | ||||
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/finish_spec.rb | 1 | ||||
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/level_spec.rb | 1 | ||||
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/mtime_spec.rb | 1 | ||||
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/orig_name_spec.rb | 27 | ||||
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/os_code_spec.rb | 1 | ||||
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/sync_spec.rb | 1 | ||||
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/to_io_spec.rb | 1 | ||||
-rw-r--r-- | spec/ruby/library/zlib/gzipfile/wrap_spec.rb | 1 |
12 files changed, 101 insertions, 0 deletions
diff --git a/spec/ruby/library/zlib/gzipfile/close_spec.rb b/spec/ruby/library/zlib/gzipfile/close_spec.rb new file mode 100644 index 0000000000..9486d6b9ec --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/close_spec.rb @@ -0,0 +1,22 @@ +require File.expand_path('../../../../spec_helper', __FILE__) +require 'stringio' +require 'zlib' + +describe "Zlib::GzipFile#close" do + it "finishes the stream and closes the io" do + io = StringIO.new "".b + Zlib::GzipWriter.wrap io do |gzio| + gzio.close + + gzio.closed?.should == true + + lambda { gzio.orig_name }.should \ + raise_error(Zlib::GzipFile::Error, 'closed gzip stream') + lambda { gzio.comment }.should \ + raise_error(Zlib::GzipFile::Error, 'closed gzip stream') + end + + io.string[10..-1].should == ([3] + Array.new(9,0)).pack('C*') + end +end + diff --git a/spec/ruby/library/zlib/gzipfile/closed_spec.rb b/spec/ruby/library/zlib/gzipfile/closed_spec.rb new file mode 100644 index 0000000000..69785bc41c --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/closed_spec.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../../../spec_helper', __FILE__) +require 'stringio' +require 'zlib' + +describe "Zlib::GzipFile#closed?" do + it "returns the closed status" do + io = StringIO.new + Zlib::GzipWriter.wrap io do |gzio| + gzio.closed?.should == false + + gzio.close + + gzio.closed?.should == true + end + end +end + diff --git a/spec/ruby/library/zlib/gzipfile/comment_spec.rb b/spec/ruby/library/zlib/gzipfile/comment_spec.rb new file mode 100644 index 0000000000..638e85a4a7 --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/comment_spec.rb @@ -0,0 +1,27 @@ +require File.expand_path('../../../../spec_helper', __FILE__) +require 'stringio' +require 'zlib' + +describe "Zlib::GzipFile#comment" do + before :each do + @io = StringIO.new + end + + it "returns the name" do + Zlib::GzipWriter.wrap @io do |gzio| + gzio.comment = 'name' + + gzio.comment.should == 'name' + end + end + + it "raises an error on a closed stream" do + Zlib::GzipWriter.wrap @io do |gzio| + gzio.close + + lambda { gzio.comment }.should \ + raise_error(Zlib::GzipFile::Error, 'closed gzip stream') + end + end +end + diff --git a/spec/ruby/library/zlib/gzipfile/crc_spec.rb b/spec/ruby/library/zlib/gzipfile/crc_spec.rb new file mode 100644 index 0000000000..6a4c1dadb4 --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/crc_spec.rb @@ -0,0 +1 @@ +require File.expand_path('../../../../spec_helper', __FILE__) diff --git a/spec/ruby/library/zlib/gzipfile/finish_spec.rb b/spec/ruby/library/zlib/gzipfile/finish_spec.rb new file mode 100644 index 0000000000..6a4c1dadb4 --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/finish_spec.rb @@ -0,0 +1 @@ +require File.expand_path('../../../../spec_helper', __FILE__) diff --git a/spec/ruby/library/zlib/gzipfile/level_spec.rb b/spec/ruby/library/zlib/gzipfile/level_spec.rb new file mode 100644 index 0000000000..6a4c1dadb4 --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/level_spec.rb @@ -0,0 +1 @@ +require File.expand_path('../../../../spec_helper', __FILE__) diff --git a/spec/ruby/library/zlib/gzipfile/mtime_spec.rb b/spec/ruby/library/zlib/gzipfile/mtime_spec.rb new file mode 100644 index 0000000000..6a4c1dadb4 --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/mtime_spec.rb @@ -0,0 +1 @@ +require File.expand_path('../../../../spec_helper', __FILE__) diff --git a/spec/ruby/library/zlib/gzipfile/orig_name_spec.rb b/spec/ruby/library/zlib/gzipfile/orig_name_spec.rb new file mode 100644 index 0000000000..42a3b2f376 --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/orig_name_spec.rb @@ -0,0 +1,27 @@ +require File.expand_path('../../../../spec_helper', __FILE__) +require 'stringio' +require 'zlib' + +describe "Zlib::GzipFile#orig_name" do + before :each do + @io = StringIO.new + end + + it "returns the name" do + Zlib::GzipWriter.wrap @io do |gzio| + gzio.orig_name = 'name' + + gzio.orig_name.should == 'name' + end + end + + it "raises an error on a closed stream" do + Zlib::GzipWriter.wrap @io do |gzio| + gzio.close + + lambda { gzio.orig_name }.should \ + raise_error(Zlib::GzipFile::Error, 'closed gzip stream') + end + end +end + diff --git a/spec/ruby/library/zlib/gzipfile/os_code_spec.rb b/spec/ruby/library/zlib/gzipfile/os_code_spec.rb new file mode 100644 index 0000000000..6a4c1dadb4 --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/os_code_spec.rb @@ -0,0 +1 @@ +require File.expand_path('../../../../spec_helper', __FILE__) diff --git a/spec/ruby/library/zlib/gzipfile/sync_spec.rb b/spec/ruby/library/zlib/gzipfile/sync_spec.rb new file mode 100644 index 0000000000..6a4c1dadb4 --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/sync_spec.rb @@ -0,0 +1 @@ +require File.expand_path('../../../../spec_helper', __FILE__) diff --git a/spec/ruby/library/zlib/gzipfile/to_io_spec.rb b/spec/ruby/library/zlib/gzipfile/to_io_spec.rb new file mode 100644 index 0000000000..6a4c1dadb4 --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/to_io_spec.rb @@ -0,0 +1 @@ +require File.expand_path('../../../../spec_helper', __FILE__) diff --git a/spec/ruby/library/zlib/gzipfile/wrap_spec.rb b/spec/ruby/library/zlib/gzipfile/wrap_spec.rb new file mode 100644 index 0000000000..6a4c1dadb4 --- /dev/null +++ b/spec/ruby/library/zlib/gzipfile/wrap_spec.rb @@ -0,0 +1 @@ +require File.expand_path('../../../../spec_helper', __FILE__) |