bdd

Multi-language integration testing framework

亡梦爱人 提交于 2019-12-06 01:34:01
问题 Imagine that you have a fairly complex service-oriented architecture made by different components. Components are written in different languages (Java, PHP, Ruby) and communicate with each other in different ways (i.e. UI, REST API, in some cases sharing some DB tables, etc). I am trying to design an integration testing framework for some end-to-end testing. We already have unit/integration tests for the single components, but we would like to build something that fully tests our deployed

Strange ordering of Kiwi iOS context blocks

∥☆過路亽.° 提交于 2019-12-06 01:21:17
I have a Kiwi spec file that looks something like this: #import "Kiwi.h" #import "MyCollection.h" SPEC_BEGIN(CollectionSpec) describe(@"Collection starting with no objects", ^{ MyCollection *collection = [MyCollection new]; context(@"then adding 1 object", ^{ MyObject *object = [MyObject new]; [collection addObject:object]; it(@"has 1 object", ^{ [collection shouldNotBeNil]; [collection.objects shouldNotBeNil]; [[theValue(collection.objects.count) should] equal:theValue(1)]; //failing test }); context(@"then removing 1 object", ^{ [collection removeObject:object]; it(@"has 0 objects", ^{ [

RSpec can't find Factorys from Factorygirl

拈花ヽ惹草 提交于 2019-12-06 00:21:59
问题 i will use RSpec with Factory girl in my Rails3 Project. I have installed factory girl but it don't find the factorys i have this error Failure/Error: Factory.build(:user).should_be valid No such factory: user spec/factories/user_factory.rb : Factory.define :user do |u| u.username 'otto' end spec/spec_helper.rb ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'factory_girl' Dir[Rails.root.join("spec/support/**/*.rb")]

Step definitions in external files in Behat

爱⌒轻易说出口 提交于 2019-12-05 21:59:39
问题 Behat by default looks for the step definitions in file named FeatureContext (all steps in one file). Having a lot of steps, it's hard to maintain such a big file. I'd like to have one definition file per feature file. How can I have step definitions in external files? e.g. homepage.feature HomepageContext extends FeatureContext 回答1: Use class inheritance and separate contexts. # /features/contexts/ AbstractContext extends BehatContext {} FeaturenameContext extends AbstractContext {} Then in

BDD/DDD Where to put specifications for basic entity validation?

前提是你 提交于 2019-12-05 21:35:54
Alternatively, is basic entity validation considered a specification(s)? In general, is it better to keep basic entity validation (name cannot be null or empty, date must be greater than xxx) in the actual entity, or outside of it in a specification? If in a specification, what would that look like? Would you have a spec for each field, or wrap it all up in one EntityIsValid type spec? It seems to me that once people have learned a little about DDD, they pick up the Specification pattern and look to apply it everywhere. That is really the Golden Hammer anti-pattern. The way I see a place for

Is there any difference between a feature spec and a view spec?

↘锁芯ラ 提交于 2019-12-05 19:05:32
I had a question about within dryness in Capybara here . Tom answered perfectly and in his answer he mentioned: Feature tests should be for testing larger behaviours in the system. Is there a difference between a feature spec and a view spec in Ruby on Rails? If possible explain it with some example please. Thank you. Yes, feature and view specs are quite different. The first is a full integration test and the second tests a view in isolation. A feature spec uses a headless browser to test the entire system from the outside just like a user uses it. It exercises code, database, views and

Maven + Cucumber-jvm - How to run different subset of the features depending on environment

巧了我就是萌 提交于 2019-12-05 18:50:19
I am strugging to achieve this: I want to configure a maven project so that it runs different subsets of the cucumber features depending on the selected profile (dev | pro) For instance, I have a couple of feature files to test web navigation, using tags to specify the environment: PRO @pro Feature: Nav Pro Scenario: navigate to home Given access / Then it should be at the home page DEV @dev Feature: Nav Dev Scenario: navigate to login and log user correctly Given access /login When the user enters xxxx yyyy Then it should be logged I created two Test java classes, one for each environment:

Can I override task :environment in test_helper.rb to test rake tasks?

♀尐吖头ヾ 提交于 2019-12-05 17:56:02
问题 I have a series of rake tasks in a Rakefile which I'd like to test as part of my specs etc. Each task is defined in the form: task :do_somthing => :environment do # Do something with the database here end Where the :environment task sets up an ActiveRecord/DataMapper database connection and classes. I'm not using this as part of Rails but I have a series of tests which I like to run as part of BDD. This snippet illustrates how I'm trying to test the rake tasks. def setup @rake = Rake:

Should TDD and BDD be used in conjunction?

感情迁移 提交于 2019-12-05 17:35:30
I am coming from a TDD mindset into BDD. I understand that using BDD is to focus on ensuring the behaviours and business goals of software are being met. What confuses me is that if I start using BDD in place of TDD, it seems I'm not able to test at such a low-level. For example, when writing a test with a TDD mindset, I might test that properties have been attached to the scope: it('should attach properties to scope', function () { expect(MainCtrl.items.length).toEqual(1); }); In doing this, another developer knows the assignment to scope was expected and required for future use, saving them

Is there a BDD solution that presently works well with iOS4 and Xcode4?

我们两清 提交于 2019-12-05 15:38:02
So I've been searching pretty hard for a solid BDD alternative for iOS4 and Xcode4, but everything seems to have either been abandoned a long time ago or sortof working but rather messily. The best solution I've found is called Cedar ( main article with a link to a recently updated project tracker), though it has some issues with Xcode4 involving a messy workaround, as noted here . Does anyone know of a better solution? Thanks! EDIT: I decided on using OCUnit and mushing the BDD syntax into the test names. This is not my ideal solution, especially since all test names must be prefixed with the