diff options
Diffstat (limited to 'spec/ruby/core/true/and_spec.rb')
-rw-r--r-- | spec/ruby/core/true/and_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/ruby/core/true/and_spec.rb b/spec/ruby/core/true/and_spec.rb new file mode 100644 index 0000000000..b81b6b36b6 --- /dev/null +++ b/spec/ruby/core/true/and_spec.rb @@ -0,0 +1,11 @@ +require File.expand_path('../../../spec_helper', __FILE__) + +describe "TrueClass#&" do + it "returns false if other is nil or false, otherwise true" do + (true & true).should == true + (true & false).should == false + (true & nil).should == false + (true & "").should == true + (true & mock('x')).should == true + end +end |