mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-21 10:54:35 +08:00
add core/true and core/false specs
This commit is contained in:
9
test/test-android/app/core/false/and_spec.rb
Normal file
9
test/test-android/app/core/false/and_spec.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
describe "FalseClass#&" do
|
||||
it "returns false" do
|
||||
(false & false).should == false
|
||||
(false & true).should == false
|
||||
(false & nil).should == false
|
||||
(false & "").should == false
|
||||
(false & mock('x')).should == false
|
||||
end
|
||||
end
|
||||
5
test/test-android/app/core/false/inspect_spec.rb
Normal file
5
test/test-android/app/core/false/inspect_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
describe "FalseClass#inspect" do
|
||||
it "returns the string 'false'" do
|
||||
false.inspect.should == "false"
|
||||
end
|
||||
end
|
||||
9
test/test-android/app/core/false/or_spec.rb
Normal file
9
test/test-android/app/core/false/or_spec.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
describe "FalseClass#|" do
|
||||
it "return false if other is nil or false, otherwise true" do
|
||||
(false | false).should == false
|
||||
(false | true).should == true
|
||||
(false | nil).should == false
|
||||
(false | "").should == true
|
||||
(false | mock('x')).should == true
|
||||
end
|
||||
end
|
||||
5
test/test-android/app/core/false/to_s_spec.rb
Normal file
5
test/test-android/app/core/false/to_s_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
describe "FalseClass#to_s" do
|
||||
it "returns the string 'false'" do
|
||||
false.to_s.should == "false"
|
||||
end
|
||||
end
|
||||
9
test/test-android/app/core/false/xor_spec.rb
Normal file
9
test/test-android/app/core/false/xor_spec.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
describe "FalseClass#^" do
|
||||
it "returns false if other is nil or false, otherwise true" do
|
||||
(false ^ false).should == false
|
||||
(false ^ true).should == true
|
||||
(false ^ nil).should == false
|
||||
(false ^ "").should == true
|
||||
(false ^ mock('x')).should == true
|
||||
end
|
||||
end
|
||||
9
test/test-android/app/core/true/and_spec.rb
Normal file
9
test/test-android/app/core/true/and_spec.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
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
|
||||
5
test/test-android/app/core/true/inspect_spec.rb
Normal file
5
test/test-android/app/core/true/inspect_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
describe "TrueClass#inspect" do
|
||||
it "returns the string 'true'" do
|
||||
true.inspect.should == "true"
|
||||
end
|
||||
end
|
||||
9
test/test-android/app/core/true/or_spec.rb
Normal file
9
test/test-android/app/core/true/or_spec.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
describe "TrueClass#|" do
|
||||
it "returns true" do
|
||||
(true | true).should == true
|
||||
(true | false).should == true
|
||||
(true | nil).should == true
|
||||
(true | "").should == true
|
||||
(true | mock('x')).should == true
|
||||
end
|
||||
end
|
||||
5
test/test-android/app/core/true/to_s_spec.rb
Normal file
5
test/test-android/app/core/true/to_s_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
describe "TrueClass#to_s" do
|
||||
it "returns the string 'true'" do
|
||||
true.to_s.should == "true"
|
||||
end
|
||||
end
|
||||
9
test/test-android/app/core/true/xor_spec.rb
Normal file
9
test/test-android/app/core/true/xor_spec.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
describe "TrueClass#^" do
|
||||
it "returns true if other is nil or false, otherwise false" do
|
||||
(true ^ true).should == false
|
||||
(true ^ false).should == true
|
||||
(true ^ nil).should == true
|
||||
(true ^ "").should == false
|
||||
(true ^ mock('x')).should == false
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user