mirror of
https://github.com/zhigang1992/redpotion.git
synced 2026-04-30 21:32:28 +08:00
Backfilling test coverage
This commit is contained in:
@@ -181,10 +181,9 @@ describe 'RubyMotionQuery ext' do
|
||||
@view.text.should.equal("test style")
|
||||
end
|
||||
end
|
||||
|
||||
describe "color" do
|
||||
before do
|
||||
@view = UIView.alloc.init
|
||||
end
|
||||
before { @view = UIView.alloc.init }
|
||||
|
||||
it "should return rmq.color" do
|
||||
@view.color.should.equal(RubyMotionQuery::Color)
|
||||
@@ -192,14 +191,38 @@ describe 'RubyMotionQuery ext' do
|
||||
end
|
||||
|
||||
describe "font" do
|
||||
before do
|
||||
@view = UIView.alloc.init
|
||||
end
|
||||
before { @view = UIView.alloc.init }
|
||||
|
||||
it "should return rmq.font" do
|
||||
@view.font.should.equal(RubyMotionQuery::Font)
|
||||
end
|
||||
end
|
||||
|
||||
describe "image" do
|
||||
before { @view = UIView.alloc.init }
|
||||
|
||||
it "should return rmq.image" do
|
||||
@view.image.should.equal(RubyMotionQuery::ImageUtils)
|
||||
end
|
||||
end
|
||||
|
||||
describe "stylesheet" do
|
||||
before { @view = UIView.alloc.init }
|
||||
|
||||
it "should return rmq.stylesheet" do
|
||||
@view.stylesheet.should.equal(@view.rmq.stylesheet)
|
||||
end
|
||||
end
|
||||
|
||||
describe "stylesheet=" do
|
||||
before { @view = UIView.alloc.init }
|
||||
|
||||
class FakeStylesheetForTest;end
|
||||
it "should set rmq.stylesheet" do
|
||||
@view.stylesheet = FakeStylesheetForTest
|
||||
@view.rmq.stylesheet.is_a?(FakeStylesheetForTest).should.be.true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "Promotion::Screen" do
|
||||
@@ -312,6 +335,7 @@ describe 'RubyMotionQuery ext' do
|
||||
@view.text.should.equal('style from sheet')
|
||||
end
|
||||
end
|
||||
|
||||
describe "color" do
|
||||
it "should return rmq.color" do
|
||||
@screen.color.should.equal(RubyMotionQuery::Color)
|
||||
@@ -323,6 +347,26 @@ describe 'RubyMotionQuery ext' do
|
||||
@screen.font.should.equal(RubyMotionQuery::Font)
|
||||
end
|
||||
end
|
||||
|
||||
describe "image" do
|
||||
it "should return rmq.image" do
|
||||
@screen.image.should.equal(RubyMotionQuery::ImageUtils)
|
||||
end
|
||||
end
|
||||
|
||||
describe "stylesheet" do
|
||||
it "should return rmq.stylesheet" do
|
||||
@screen.stylesheet.should.equal(@screen.rmq.stylesheet)
|
||||
end
|
||||
end
|
||||
|
||||
describe "stylesheet=" do
|
||||
class FakeStylesheetForTest;end
|
||||
it "should set rmq.stylesheet" do
|
||||
@screen.stylesheet = FakeStylesheetForTest
|
||||
@screen.rmq.stylesheet.is_a?(FakeStylesheetForTest).should.be.true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
class TestView < UIView
|
||||
|
||||
Reference in New Issue
Block a user