无法正确显示Twitter Bootstrap glyphicons(Unable to properly display Twitter Bootstrap glyphicons)
我正在研究Angular.js Todo应用程序视频教程,我遇到了一个问题,包括index.html文件中的Twitter Bootstrap 3 glyphicons(这些图标在Chrome和Firefox中都显示为非描述性图像)。
这就是我在index.html中添加bootstrap和bootstrap-glyphicons css文件的方法:
<head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> <script src="http://documentcloud.github.com/underscore/underscore-min.js"></script> <script type="text/javascript" src="todo.js"></script> <link rel="stylesheet" href="bootstrap/css/bootstrap.css"> <link rel="stylesheet" href="bootstrap/css/bootstrap-glyphicons.css"> <link rel="stylesheet" href="todo.css"> </head>
这就是我稍后在文件中添加所需的glyphicon的方法:
<form class="form-horizontal"> <input type="text" ng-model="formTodoText" ng-model-instant> <button class="btn"><i class="glyphicon glyphicon-plus"></i>Add</button> </form>
bootstrap-glyphicons字体文件位于bootstrap / css / fonts中。 具体来说,文件是:
- glyphiconshalflings-regular.eot
- glyphiconshalflings-regular.otf
- glyphiconshalflings-regular.svg
- glyphiconshalflings-regular.ttf
- glyphiconshalflings-regular.woff
有关如何正确访问图标的任何想法? 非常感谢你的帮助!
I was working through the Angular.js Todo application video tutorial and I encountered a problem including the Twitter Bootstrap 3 glyphicons in the index.html file (the icons show up as non-descriptive images, both in Chrome and in Firefox).
This is how I am adding the bootstrap and bootstrap-glyphicons css files in index.html:
<head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> <script src="http://documentcloud.github.com/underscore/underscore-min.js"></script> <script type="text/javascript" src="todo.js"></script> <link rel="stylesheet" href="bootstrap/css/bootstrap.css"> <link rel="stylesheet" href="bootstrap/css/bootstrap-glyphicons.css"> <link rel="stylesheet" href="todo.css"> </head>
And this is how I am adding the required glyphicon later in the file:
<form class="form-horizontal"> <input type="text" ng-model="formTodoText" ng-model-instant> <button class="btn"><i class="glyphicon glyphicon-plus"></i>Add</button> </form>
The bootstrap-glyphicons fonts files are in bootstrap/css/fonts. Specifically, the files are:
- glyphiconshalflings-regular.eot
- glyphiconshalflings-regular.otf
- glyphiconshalflings-regular.svg
- glyphiconshalflings-regular.ttf
- glyphiconshalflings-regular.woff
Any thoughts on what to do to properly access the icons? Thank you so much for your help!
原文:https://stackoverflow.com/questions/18109748
最满意答案
实际上你的问题在错误信息中:
此外,此错误可能会显示,因为您验证: final / private / equals()/ hashCode()方法之一。 这些方法无法进行存根/验证。
实际上,您尝试隐式验证对
BarImpl#deinit
调用,这是final
方法,而Mockio
不支持final
方法Mockio
,如文档中所述 。 如果要验证它,您需要从BarImpl#deinit
的声明中删除关键字final
,或者使用Powermock 。Actually your problem is in the error message:
Also, this error might show up because you verify either of: final/private/equals()/hashCode() methods. Those methods cannot be stubbed/verified.
Indeed you try to implicitly verify calls to
BarImpl#deinit
which is afinal
method andMockio
doesn't supportfinal
method mocking as explained into the doc. If you want to verify it you need either to remove the keywordfinal
from the declaration ofBarImpl#deinit
or use Powermock instead.
相关问答
更多-
验证重载方法调用(Verify Overloaded Method Call)[2023-08-13]
令人尴尬的是,我发现我的问题的解决方案是一个简单错误的结果。 我将发布答案以供参考。 创建ArgumentCaptor时,请使用泛型指定您期望的参数类型。 我已经做到了这一点,但遗憾的是我使用了我不希望被调用的方法的其他版本之一的类型。 简单的错误。 // This declaration ArgumentCaptorarguments = ArgumentCaptor.forClass(LoggingEvent.class); // Should have been: Ar ... -
使用Moq验证方法调用(Verify a method call using Moq)[2022-03-12]
你正在检查错误的方法。 Moq要求您在依赖关系类中设置(然后可选地验证)方法。 你应该做更像这样的事情: class MyClassTest { [TestMethod] public void MyMethodTest() { string action = "test"; MockmockSomeClass = new Mock (); mockSomeClass.Setup(mock ... -
在你的测试而不是 RequestHandler requestHandler=mock(RequestHandler.class,CALLS_REAL_METHODS); 使用Mockito.spy() : RequestHandler requestHandler=spy(RequestHandler.class); doReturn(result).when(requestHandler).processRequest(httpRequest); 你可能想要doReturn( ...
-
从异常消息中,问题是这一行: PowerMockito.verifyPrivate(sysParamsBuilder).invoke("getMclPatientSize",origPatSize);//line 241 使用谷歌搜索powermockito verifyprivate not working我找到以下页面: https : powermockito verifyprivate not working 简而言之,如果你想使用PowerMockito监视你的对象,你一定不能这样做 S ...
-
在测试中,会创建一个模拟调度程序,但测试对象不会使用它。 如果注入调度程序,则可以使方法可测试,而不是在基类中实例化一个。 例如,您可以将调度程序作为BaseClass构造函数的参数 In your test, a mock scheduler is created, but it is not used by the object under test. You can make the method testable if you inject the scheduler, instead of ins ...
-
所以,事实证明,我对你如何测试打补丁模块并不知情。 import module def test_Calling(mocker): mock_Called = mocker.patch('module.Called') module.Calling('argument') mock_called.assert_has_calls([ mocker.call('argument'), mocker.call().check_me()]) 这里需要 ...
-
Mockito验证:在验证()期间验证,而不是在模拟方法调用期间验证(Mockito Verify: Verified during verify() than during mocked method call)[2022-10-21]
之前已经问过 - 在Can Mockito根据方法调用时的值验证参数? 当您调用已经使用Mockito存根的方法时,Mockito将存储传递给它的参数,以便您以后可以使用verify 。 也就是说,它存储对象引用,而不是对象本身的内容。 如果稍后更改这些对象的内容,则verify调用将其参数与更新的对象进行比较 - 它不会生成原始对象的深层副本。 如果您需要验证对象的内容是什么,则需要使用 在方法调用时自己存储它们; 要么 在方法调用时验证它们。 正确的方法是使用Mockito Answer 。 因此,对于 ... -
实际上你的问题在错误信息中: 此外,此错误可能会显示,因为您验证: final / private / equals()/ hashCode()方法之一。 这些方法无法进行存根/验证。 实际上,您尝试隐式验证对BarImpl#deinit调用,这是final方法,而Mockio不支持final方法Mockio ,如文档中所述 。 如果要验证它,您需要从BarImpl#deinit的声明中删除关键字final ,或者使用Powermock 。 Actually your problem is in the e ...
-
您可以使用Callbacks捕获呼叫: [Test] public void AfterOperationCursorIsArrow() { string lastMethod = null; Cursor lastCursor = null; var mock = new Mock
(); mock.Setup(m => m.ForceCursor(It.IsAny ())) .Callback((Cursor c ... -
编辑:原帖(底部)不正确。 一个工作解决方案是: @mock_verifier.instance_eval { def assert @expected_calls.each do |name, expected| actual = @actual_calls.fetch(name, nil) raise MockExpectationError, "expected #{__call name, exp ...