mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 17:39:54 +08:00
start rubymotion-specific String specs
This commit is contained in:
@@ -14,7 +14,7 @@ class ShouldResult < Java::Lang::Object
|
||||
|
||||
def ==(x)
|
||||
if (@obj == x) != @res
|
||||
puts "Expectation failed (expected `#{@obj}' == `#{x}')"
|
||||
puts "Expectation failed (expected `#{@obj}' (#{@obj.class}) == `#{x}' (#{x.class}))"
|
||||
$expectations_failures += 1
|
||||
end
|
||||
$expectations_total += 1
|
||||
|
||||
13
test/test-android/app/rubymotion/string_spec.rb
Normal file
13
test/test-android/app/rubymotion/string_spec.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
describe "Strings" do
|
||||
it "are based on com.rubymotion.String" do
|
||||
'foo'.class.should == String
|
||||
'foo'.class.inspect.should == 'com.rubymotion.String'
|
||||
end
|
||||
|
||||
it "can be passed to Java methods expecting a java.lang.CharSequence" do
|
||||
str_builder = Java::Lang::StringBuilder.new
|
||||
str_builder.append('hello')
|
||||
str_builder.append(' world')
|
||||
str_builder.toString.should == 'hello world'
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user