require_relative '../../../spec_helper' describe :numeric_arg, shared: true do before :each do @numbers = [ 20, Rational(3, 4), bignum_value, infinity_value ] end it "returns 0 if positive" do @numbers.each do |number| number.send(@method).should == 0 end end it "returns Pi if negative" do @numbers.each do |number| (0-number).send(@method).should == Math::PI end end describe "with a Numeric subclass" do it "returns 0 if self#<(0) returns false" do numeric = mock_numeric('positive') numeric.should_receive(:<).with(0).and_return(false) numeric.send(@method).should == 0 end it "returns Pi if self#<(0) returns true" do numeric = mock_numeric('positive') numeric.should_receive(:<).with(0).and_return(true) numeric.send(@method).should == Math::PI end end end The Ruby Programming Language
summaryrefslogtreecommitdiff
path: root/lib/tempfile.rb
AgeCommit message (Expand)Author
2021-09-01Small grammar fixesStan Lo
2020-10-05[ruby/tempfile] Improve the documentation for Tempfile.create and recommend T...Benoit Daloze
2020-09-09[ruby/tempfile] Revert Tempfile.open unlinking the fileJeremy Evans
2020-08-29Sync with ruby/tempfile@aa9ea12d94a905161cbd79af1ad9ab427f250f4eBenoit Daloze
2019-11-18Warn on access/modify of $SAFE, and remove effects of modifying $SAFEJeremy Evans
2019-09-25Make rb_scan_args handle keywords more similar to Ruby methods (#2460)Jeremy Evans
2019-09-06Fix Tempfile.open to correctly pass keywords to Tempfile.newJeremy Evans
2019-08-30Fix keyword argument separation issues in libJeremy Evans
2019-07-03Try to avoid `not delagated` errorKazuhiro NISHIYAMA
2018-12-16Enhance Tempfile docs [ci skip]nobu
2018-12-14No document of Tempfile::Remover [ci skip]nobu
2017-12-12Add uplevel keyword to Kernel#warn and use itshyouhei
2017-10-17tempfile.rb: [DOC] all arguments [ci skip]nobu
2017-10-16Layout fixes in rdoc of lib/tempfile.rb [ci skip]nobu
2017-05-19tempfile.rb: do not call File.identical? on closed streamnobu
2017-05-19tempfile.rb: remove in Tempfile.createnobu
2017-03-14Fix bug of Tempfile#size if nothing is written [Bug #13198]glass
2017-01-21lib/tempfile.rb: Specify frozen_string_literal: true.kazu
2016-11-21lib/*: remove closed checksnormal
2016-09-26* lib/tempfile.rb: provide default basename parametersonots
2016-01-27Fix doc with default value with GH-523nobu
2015-12-16Add frozen_string_literal: false for all filesnaruse
2015-06-13* lib/tempfile.rb: Fix typo. [fix GH-933] Patch by @Zorbashhsbt
2015-05-30* lib/tempfile.rb (Remover#call): fixed wrong condition introduced atusa
2015-05-30* lib/tempfile.rb (Tempfile#initialize): initialize @unlinked to fixusa
2015-05-30* lib/tempfile.rb: refactoring.glass
2015-01-04* lib/tempfile.rb: provide default basename parameter.hsbt