forked from IronLanguages/main
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…File#finish. My commit is the code review.
- Loading branch information
Shri Borde
committed
Apr 2, 2009
1 parent
2926dd7
commit ec7270c
Showing
10 changed files
with
103 additions
and
68 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
Merlin/External/Languages/IronRuby/mspec/ironruby-tags/library/zlib/gzipfile/close_tags.txt
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
Merlin/External/Languages/IronRuby/mspec/ironruby-tags/library/zlib/gzipfile/closed_tags.txt
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
...in/External/Languages/IronRuby/mspec/ironruby-tags/library/zlib/gzipfile/comment_tags.txt
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
.../External/Languages/IronRuby/mspec/ironruby-tags/library/zlib/gzipfile/orig_name_tags.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
Merlin/External/Languages/IronRuby/mspec/rubyspec/library/zlib/gzipfile/fixtures/classes.rb
This file was deleted.
Oops, something went wrong.
40 changes: 29 additions & 11 deletions
40
Merlin/External/Languages/IronRuby/mspec/rubyspec/library/zlib/gzipfile/orig_name_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,46 @@ | ||
require File.dirname(__FILE__) + '/../../../spec_helper' | ||
require File.dirname(__FILE__) + '/fixtures/classes' | ||
require 'stringio' | ||
require 'zlib' | ||
|
||
describe 'Zlib::GzipFile#orig_name' do | ||
before :each do | ||
@io = StringIO.new | ||
@gzip_writer = Zlib::GzipWriter.new @io | ||
end | ||
|
||
it 'is nil by default' do | ||
@gzip_writer.orig_name.should be_nil | ||
end | ||
|
||
it 'returns the name' do | ||
Zlib::GzipWriter.wrap @io do |gzio| | ||
gzio.orig_name = 'name' | ||
@gzip_writer.orig_name = 'name' | ||
@gzip_writer.orig_name.should == 'name' | ||
end | ||
end | ||
|
||
gzio.orig_name.should == 'name' | ||
end | ||
describe 'Zlib::GzipFile#orig_name=' do | ||
before :each do | ||
@io = StringIO.new | ||
@gzip_writer = Zlib::GzipWriter.new @io | ||
end | ||
|
||
it 'returns the argument' do | ||
n = 'name' | ||
(@gzip_writer.orig_name = n).should equal(n) | ||
end | ||
|
||
it 'raises TypeError if argument is nil' do | ||
lambda { @gzip_writer.orig_name = nil }.should raise_error(TypeError) | ||
end | ||
|
||
it 'raises TypeError if argument is not a String' do | ||
m = mock("name").should_receive(:to_s).any_number_of_times.and_return("name") | ||
lambda { @gzip_writer.orig_name = m }.should raise_error(TypeError) | ||
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 | ||
@gzip_writer.close | ||
lambda { @gzip_writer.orig_name = 'name' }.should raise_error(Zlib::GzipFile::Error) | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ec7270c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, this is make senses to me.