From 994833085ae06afbe94d30ab183d80e0234fbe14 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 28 Apr 2019 23:20:09 +0200 Subject: Update to ruby/mspec@c25d63d --- spec/mspec/spec/helpers/io_spec.rb | 42 ++------------------------------------ 1 file changed, 2 insertions(+), 40 deletions(-) (limited to 'spec/mspec/spec') diff --git a/spec/mspec/spec/helpers/io_spec.rb b/spec/mspec/spec/helpers/io_spec.rb index 3219f59947..86e42097f8 100644 --- a/spec/mspec/spec/helpers/io_spec.rb +++ b/spec/mspec/spec/helpers/io_spec.rb @@ -64,7 +64,7 @@ describe Object, "#new_fd" do fd = new_fd @name fd.should be_kind_of(Integer) - @io = IO.new fd, fmode('w:utf-8') + @io = IO.new fd, 'w:utf-8' @io.sync = true @io.print "io data" @@ -76,7 +76,7 @@ describe Object, "#new_fd" do fd = new_fd @name, { :mode => 'w:utf-8' } fd.should be_kind_of(Integer) - @io = IO.new fd, fmode('w:utf-8') + @io = IO.new fd, 'w:utf-8' @io.sync = true @io.print "io data" @@ -134,41 +134,3 @@ describe Object, "#new_io" do IO.read(@name).should == "io data" end end - -describe Object, "#fmode" do - it "returns the argument unmodified if :encoding feature is enabled" do - FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(true) - fmode("rb:binary:utf-8").should == "rb:binary:utf-8" - end - - it "returns only the file access mode if :encoding feature is not enabled" do - FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(false) - fmode("rb:binary:utf-8").should == "rb" - end -end - -describe Object, "#options_or_mode" do - describe "if passed a Hash" do - it "returns a mode string if :encoding feature is not enabled" do - FeatureGuard.should_receive(:enabled?).with(:encoding).twice.and_return(false) - options_or_mode(:mode => "rb:binary").should == "rb" - end - - it "returns a Hash if :encoding feature is enabled" do - FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(true) - options_or_mode(:mode => "rb:utf-8").should == { :mode => "rb:utf-8" } - end - end - - describe "if passed a String" do - it "returns only the file access mode if :encoding feature is not enabled" do - FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(false) - options_or_mode("rb:binary:utf-8").should == "rb" - end - - it "returns the argument unmodified if :encoding feature is enabled" do - FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(true) - options_or_mode("rb:binary:utf-8").should == "rb:binary:utf-8" - end - end -end -- cgit v1.2.3