我有一个使用Test :: Unit和mocha的旧rails应用程序,我试图测试一个对象是否接收到特定的方法调用。我知道我可以用摩卡这样说:
Sample Model below:
Public Class EmployeeData
{
Public Employee Emp {get;set;}
}
Public Class Employee
{
Public String EmployeeId {get;set;}
Public String EmployeeName {get;set;}
Public List<Department> Dep {get;set;}
}
Public Class Department
{
Public String DepartmentId {get;set;}
Public String DepartmentName {get;set;}
Public List<Address> Addr {get;set;}
}
Public Class Address
{
Public String AddrOne {get;set;}
Public String City {get;set;}
}
问题是,我希望对象仍然执行我希望它接收的方法。我知道在rspec中我能说:
object.expects(:method)
是否有mocha的等价物?