$: = '/users/joecool/rubylib'
$: << '/users/joecool/rubylib'
$:.unshift('/users/joecool/rubylib')
ruby -c somescript.rb
ruby -e "puts 'Hello, world!'
Run Code Online (Sandbox Code Playgroud)
有人可以指导我阅读,以便我可以弄清楚这段代码的作用吗?
我正在研究使用jQuery文本功能时谷歌浏览器中的一个奇怪的行为:
$(document).ready(function () {
$("#btnSubmit").click(function () {
var t = $('#txtMessage').text();
alert(t); //this shows nothing in Google Chrome, but works in IE9
});
});
Run Code Online (Sandbox Code Playgroud)
当我var t = $('#txtMessage').text();改为var t = $('#txtMessage').val();它在Chrome中工作.
那么,text()函数有什么问题?
PS:txtMessage是一个textarea
我正在使用Rhino Mocks 3.6.我见过很多类型的编码.有时使用静态GenerateMock方法,有时使用new MockRepository().我不太了解发生了什么或什么更好.也许有些方法已经过时,但无论如何,让我们回到真正的问题.
我想更好地了解下面的代码中发生了什么,以及更好的测试需要什么.
[TestMethod]
public void TestingProperty()
{
Person repository = MockRepository.GenerateMock<Person>();
// tell rhino.mocks when FirstName is called in the next time, it should return "Monica"
repository.Expect(x => x.Title).Return("Monica");
// get the mocking ready
repository.Replay();
repository.VerifyAllExpectations();
// when getting repository.Title value, we should receive "Monica" defined previously in expectation
Assert.AreEqual(repository.Title, "Monica");
}
Run Code Online (Sandbox Code Playgroud)
我注意到当我移除时repository.Replay(),一切都在继续工作.重播的目的是什么,是否需要?
还需要VerifyAllExpectations吗?它在内部做什么?
我可以避免手动输入"Monica"并为Person设置一个真实的模拟对象吗?
如果这是一个错误的代码,请告诉我你的建议!
我想让我的客户通过手机在我的网站上阅读他们的数据.
我的网站是ASP.NET应用程序.
我看到诺基亚和Apple都有自己的SDK,可以让你完成创建软件应用程序.