tdd

Jasmine object “has no method 'andReturn'”

依然范特西╮ 提交于 2019-12-08 14:29:59
问题 Beginner with Jasmine, very first attempt with Jasmine Spies. I thought I was mimicking the format displayed here (search: "andReturn"), but I'm getting an error that I can't work out: TypeError: Object function () { callTracker.track({ object: this, args: Array.prototype.slice.apply(arguments) }); return spyStrategy.exec.apply(this, arguments); } has no method 'andReturn' No clue what I'm doing wrong. Here's my Spec: describe('Die', function() { it('returns a value when you roll it',

Testem gulp task hangs after finished

一笑奈何 提交于 2019-12-08 13:46:39
问题 This gulp task doesn't exit after finished, I have to manually press Ctrl-C to exit. gulp.task('test', function(done) { var testem = require('testem'); var testemOptions = { file: 'testem.json' }; var t = new testem(); t.startCI(testemOptions, done); }); How can i make this task exit properly? Note: Actually it exits itself, but it takes like 15 seconds after finished. Output: [15:49:59] Using gulpfile ~/gulpfile.js [15:49:59] Starting 'test'... ok 1 PhantomJS 1.9 - Integration Tests: Home

How to install PHPUnit using composer in Windows 07 64 bit?

牧云@^-^@ 提交于 2019-12-08 12:46:39
问题 I have windows 07 64-bit OS and I have downloaded the composer as well as I am running wampserver wampserver2.2e-php5.3.13-httpd2.2.22-mysql5.5.24-x64.exe . I have tried to install PHPUnit using composer but couldn't. I found the installation steps on linux/ mac os but not in windows. Some site suggested to add a dependency on phpunit/phpunit to the php project's composer.json file. But how? I don't know. Please help me for the installation of PHPUnit using composer on wampserver(windows 07

Ruby Koan 182 - Greed Dice

痴心易碎 提交于 2019-12-08 10:23:37
问题 I'm quickly coming to the conclusion that I can't be a programmer. Despite taking ample notes and practicing everything in Ruby Koans up to this point on top of going through the Ruby course on Codecademy three times and currently making my way through Chris Pine's book averaging 6hrs a day studying...this current Koan is an exercise in frustration and the realization that not everyone can be a programmer. The exercise is as follows # Greed is a dice game where you roll up to five dice to

How to configure Cruise Control.Net to show proper error in Web Dashboard?

ぃ、小莉子 提交于 2019-12-08 09:43:51
问题 We have setup Cruise Control.Net to build .Net projects from source control. Problem is that when the build fails the error log shows a huge build xml and we struggle to find out the actual error. How to configure Cruise Control to show error in more readable format? 回答1: Make sure that a xmllogger is included in your ccnet configuration and try viewing the build results via ccnet's web dashboard. See example of failed build output. 回答2: To make it even more readable (bring the project name

How can I do TDD and Unit Testing for EF Code First entity declaration and mapping?

亡梦爱人 提交于 2019-12-08 09:18:29
问题 I have am about to retro-code a suite of unit tests for a new MVC4 app. Because nearly all my code in the EF data project is copied straight from code generated by the VS2012 EF Reverse Engineering tool, I have decided to skip unit tests in this part of the application, unless I can somehow automatically generate them. I have no business logic at here and I would like to first concentrate my efforts on ensuring better QA on the business side. But, I would like to know how one goes about first

Best resources for learning TDD with Rails [closed]

风格不统一 提交于 2019-12-08 06:03:58
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I've finally gotten a handle on rails, and feel comfortable enough with it to start learning best practices, with the first on my list

How to write test code before write source code when they are objects dependencies?

為{幸葍}努か 提交于 2019-12-08 05:40:26
问题 I'l will take an example: requirement : construct a piece of material following these rule: among given < 100 => material is green 100 < among <300=> material is yellow among > 300=> material is red My test class: class MaterialTest{ MaterialConstructor materialCons public void testBuild(){ materialCons.setAmount(150); Material material=materialCons.build(); assertEqual(material.getColor(),"Yellow"); } } From know i don't how to implemented materialCons.build(); After design and analysis i've

rspec test a private method within a private method that needs to be stubbed

為{幸葍}努か 提交于 2019-12-08 03:12:29
问题 Simplecov detected that I was missing some tests on my lib/api_verson.rb class: class ApiVersion def initialize(version) @version = version end def matches?(request) versioned_accept_header?(request) || version_one?(request) end private def versioned_accept_header?(request) accept = request.headers['Accept'] accept && accept[/application\/vnd\.#{Rails.application.secrets.my_app_accept_header}-v#{@version}\+json/] end def unversioned_accept_header?(request) accept = request.headers['Accept']

TDD on client-server application

北慕城南 提交于 2019-12-08 02:43:37
问题 Currently I'm creating a server application to receive protocol-specific messages. I need to create tests to ensure that I've implemented the protocol correctly. Is this some kind of integration testing? If positive, can I make an integration testing with unit testing tools? And finally, what is the best way to create these kind of tests? 回答1: If you know what the correct responses are, then here's what I'd do: Separate the class responsible for the logic of handling the protocol from the