Fixtures in RSpec

If you want to use fixtures with RSpec, specify your fixtures in the describe block, not within a before block: describe StudentsController do fixtures :students before do # more test setup end end Your student fixtures will get loaded into the students table and then rolled back at the end of each test using database … Read more

Unit test and private vars

(Note that Swift 2 adds the @testable attribute which can make internal methods and properties available for testing. See @JeremyP’s comments below for some more information.) No. In Swift, private is private. The compiler can use this fact to optimize, so depending on how you use that property, it is legal for the compiler to … Read more

Testing browser extensions

I practise two different ways of testing my browser extensions: Unit tests Integration test Introduction I will use the cross-browser YouTube Lyrics by Rob W extension as an example throughout this answer. The core of this extension is written in JavaScript and organized with AMD modules. A build script generates the extension files for each … Read more

What Behavior Driven Development (BDD) Tooling/Frameworks are available for the Microsoft Stack? [closed]

+1 for people’s recommendation of SpecFlow for scenarios; never used it but heard many good things about it. I’ve been using plain old NUnit with a little DSL like this. MSTest would work similarly. You can also do BDD in the unit space, which is what MSpec is designed to do. I’m personally hating MSpec, … Read more

Are there any non-developer tools to edit gherkin files? [closed]

Here is a non-developer tool. We had a similar requirement and I wanted to have a stab at creating a Chrome extension. It’s free and there are no ads. Above all it is cross-platform and requires no technical knowledge to install and run. https://chrome.google.com/webstore/detail/tidy-gherkin/nobemmencanophcnicjhfhnjiimegjeo I know this is an old post, but I came across … Read more

Best way to implement Repository Pattern?

There’s also a good argument for a “none of the above” approach. The problem with generic repositories is that you’re making the assumption that all objects in your system will support all four CRUD operations: Create, Read, Update, Delete. But in complex systems, you’ll likely have objects that support only a few of the operations. … Read more

Cuke4Nuke or SpecFlow?

(I might be biased because I am involved with SpecFlow, but here my thoughts…) Cuke4Nuke is very close to Cucumber. This promises a lot of advantages: Compatibility Getting new features from Cucumber when Cucumber evolves (at least in theory, but language support is an example for this) Being a real part of the Cucumber community … Read more

Am I writing my first MSpec specifications correctly?

The context looks good. I like the way you solved the conflicting It with aliases. I would argue that the Moq alias can be improved. Consider something sentence-like. For example, Param.Is<T> or Value.Is<T>. Some notes, with code snippets, then the whole spec rewritten at the bottom. The Scenario is your Subject The Subject can be … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)