Sha256: af97f82d2f3ae1e9e616ed1623e8928f68a865fb0d12faa97bf4c25ed4c80dde
Contents?: true
Size: 1.07 KB
Versions: 1
Compression:
Stored size: 1.07 KB
Contents
# encoding: utf-8 # # This file is part of the lazier gem. Copyright (C) 2013 and above Shogun <shogun_panda@me.com>. # Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php. # require "spec_helper" describe Lazier::Math do let(:first) { 1 } let(:second) { 2 } let(:third) { 0 } before(:all) do ENV["LANG"] = "en" ::Lazier.load! end describe "::min" do it "should return the minimum argument" do expect(::Math.min(first)).to eq(first) expect(::Math.min(first, second)).to eq(first) expect(::Math.min([first, [second, third]])).to eq(third) end it "should return nil for an empty array" do expect(::Math.min()).to be_nil end end describe "::max" do it "should return the maximum argument" do expect(::Math.max(first)).to eq(first) expect(::Math.max(first, second)).to eq(second) expect(::Math.max([first, [second, third]])).to eq(second) end it "should return nil for an empty array" do expect(::Math.max()).to be_nil end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lazier-2.6.0 | spec/lazier/math_spec.rb |