require_relative '../../spec_helper' require_relative 'fixtures/classes' describe "Array#include?" do it "returns true if object is present, false otherwise" do [1, 2, "a", "b"].include?("c").should == false [1, 2, "a", "b"].include?("a").should == true end it "determines presence by using element == obj" do o = mock('') [1, 2, "a", "b"].include?(o).should == false def o.==(other); other == 'a'; end [1, 2, o, "b"].include?('a').should == true [1, 2.0, 3].include?(2).should == true end it "calls == on elements from left to right until success" do key = "x" one = mock('one') two = mock('two') three = mock('three') one.should_receive(:==).any_number_of_times.and_return(false) two.should_receive(:==).any_number_of_times.and_return(true) three.should_not_receive(:==) ary = [one, two, three] ary.include?(key).should == true end end y_1_8_6'>ruby_1_8_6 The Ruby Programming Language
summaryrefslogtreecommitdiff
path: root/regint.h
AgeCommit message (Expand)Author
2017-02-11Merge Onigmo 6.1.1naruse
2016-12-24regint.h: version for secure functionsnobu
2016-12-10Merge Onigmo 6.0.0naruse
2016-04-30revert UNALIGNED_WORD_ACCESS for GCC6naruse
2016-01-15disable unaligned word accessnobu
2016-01-15* regint.h (PLATFORM_UNALIGNED_WORD_ACCESS): The value ofngoto
2015-12-09Revert r52995nobu
2015-12-09use atomic operationsnobu
2015-11-26* regcomp.c, regenc.c, regexec.c, regint.h, enc/unicode.c:naruse
2014-10-17* Avoid undefined behaviors found by gcc -fsanitize=undefined.akr
2014-09-15* reg*.c: Merge Onigmo 5.15.0 38a870960aa7370051a3544naruse
2014-07-23UNALIGNED_WORD_ACCESS on ppc64nobu
2014-07-16* regcomp.c: Merge Onigmo 5.14.1 25a8a69fc05ae3b56a09.naruse
2013-04-13* Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee.naruse
2013-04-10* regint.h: fix typo: _M_AMD86 -> _M_AMD64.naruse
2013-04-05defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END}nobu
2013-03-01* Merge Onigmo 0fe387da2fee089254f6b04990541c731a26757fnaruse
2012-03-22* regint.h (BITS_IN_ROOM, BS_ROOM, BS_BIT): suppress warnings.nobu
2012-02-17* Merge Onigmo-5.13.1. [ruby-dev:45057] [Feature #5820]naruse
2011-12-15* regcomp.c (onig_region_memsize): implemented for memsize_of().nobu
2011-07-14* regint.h (PLATFORM_UNALIGNED_WORD_ACCESS): Power PC does notnobu
2011-01-31* addr2line.c: suppressed shorten-64-to-32 warnings.naruse
2010-11-17* regint.h (OnigOpInfoType): constify name.naruse