New answers tagged

2

I didn't manage to find anything that met my needs, so created the CarbonDate Ruby gem. https://rubygems.org/gems/carbon_date https://github.com/bradleymarques/carbon_date


1

Sorry but this 'problem' doesn't make much sense. It is either intentionally confusing or there is just some kind of typo. It is possible in Ruby to open a class and add new methods, like class Symbol def name self end end which would basically allow x_port.nature to return its current value as seems expected in the tests. This as such would be ...


10

The short answer is "No". The more interesting part is why/how this situation might arise. I think the confusion is arising because you're trying to adhere to strict testing practices (unit tests vs integration tests, mocking, etc.) for code which doesn't seem to adhere to strict practices. That's not to say the code is "wrong", or that particular ...


8

Another point I like to add to Killian's answer is that unit tests run very quickly, so we can have 1000s of them. An integration test typically takes longer because it is calling web services, databases, or some other external dependency, so we cannot run the same tests (1000s) for integration scenarios as they would take too much time. Also, unit tests ...


0

... As far as I know its just a MVC framework for Ruby web development. Some articles talk about ActiveRecords ORM and other subjects in a way that it seems that those gems are almost exclusive for Rails development. Is that only because Rails is very popular, almost more than Ruby itself, and because of that most blogs are from Rails guys so they talk in ...


60

No, integration tests should not just duplicate the coverage of unit tests. They may duplicate some coverage, but that's not the point. The point of a unit test is to ensure that a specific small bit of functionality works exactly and completely as intended. A unit test for am_i_old_enough would test data with different ages, certainly the ones near the ...



Top 50 recent answers are included