diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-14 14:09:29 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-14 14:09:29 +0000 |
commit | 6dd3ff482f37cf043fa47dfcd98f687c8c92a58d (patch) | |
tree | 9cd3284741ac193a3db70164d5cfbef55ed74587 /spec/mspec/spec | |
parent | e3d4de351259c299a461ddabbd4dbb04590400f1 (diff) |
Update to ruby/mspec@4b980493
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/mspec/spec')
-rw-r--r-- | spec/mspec/spec/helpers/suppress_warning_spec.rb | 19 | ||||
-rw-r--r-- | spec/mspec/spec/utils/script_spec.rb | 13 |
2 files changed, 26 insertions, 6 deletions
diff --git a/spec/mspec/spec/helpers/suppress_warning_spec.rb b/spec/mspec/spec/helpers/suppress_warning_spec.rb new file mode 100644 index 0000000000..d16361fa55 --- /dev/null +++ b/spec/mspec/spec/helpers/suppress_warning_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' +require 'mspec/guards' +require 'mspec/helpers' + +describe Object, "#suppress_warning" do + it "hides warnings" do + suppress_warning do + warn "should not be shown" + end + end + + it "yields the block" do + a = 0 + suppress_warning do + a = 1 + end + a.should == 1 + end +end diff --git a/spec/mspec/spec/utils/script_spec.rb b/spec/mspec/spec/utils/script_spec.rb index 62f6787acd..20b5d293b0 100644 --- a/spec/mspec/spec/utils/script_spec.rb +++ b/spec/mspec/spec/utils/script_spec.rb @@ -356,9 +356,9 @@ describe MSpecScript, "#entries" do end it "returns the pattern in an array if it is a file" do - File.should_receive(:expand_path).with("file").and_return("file/expanded") - File.should_receive(:file?).with("file/expanded").and_return(true) - @script.entries("file").should == ["file/expanded"] + File.should_receive(:expand_path).with("file").and_return("file/expanded.rb") + File.should_receive(:file?).with("file/expanded.rb").and_return(true) + @script.entries("file").should == ["file/expanded.rb"] end it "returns Dir['pattern/**/*_spec.rb'] if pattern is a directory" do @@ -381,9 +381,10 @@ describe MSpecScript, "#entries" do end it "returns the pattern in an array if it is a file" do - File.should_receive(:expand_path).with(@name).and_return(@name) - File.should_receive(:file?).with(@name).and_return(true) - @script.entries("name").should == [@name] + name = "#{@name}.rb" + File.should_receive(:expand_path).with(name).and_return(name) + File.should_receive(:file?).with(name).and_return(true) + @script.entries("name.rb").should == [name] end it "returns Dir['pattern/**/*_spec.rb'] if pattern is a directory" do |