Aaron Bedra's complete blog can be found at: http://aaronbedra.com

Items:   1 to 5 of 40   Next »

Friday, October 16, 2009

Tell RCov to Cov Off

16 Oct 2009

Chad and I just released a new version of RCov! This version offers the ability to tell RCov to ignore certain pieces of code. This is useful if you are experiencing an bug in RCov, or if you just plain old disagree with RCov about the coverage status of a particular chunk of code. Here’s an example of implementation:

class Foo
  def bar
    1 + 2
  end

  #:nocov:
  def quux
    "s" + "hit"
  end
  #:nocov:

end

require 'test/unit'
class FooTest < Test::Unit::TestCase
  def test_bar
    assert_equal 3, Foo.new.bar
  end
end

Running this will show you 100% code coverage. This feature (for now) is pretty simple and does not do anything more than tell RCov to count the code as covered. If this feature takes off, I will spend more time making it smarter about the code and reporting so that you can easily tell the difference.


Friday, August 14, 2009

RCov Examples

14 Aug 2009

Are you interested in trying out RCov? Are you unsure of how to start? Are you looking to improve the RCov-fu on your project? I have just the solution for you! I have started a project that demonstrates different RCov configurations for different testing frameworks. This project is meant to help spread RCov related knowledge. You can get the bits by running:

git clone git://github.com/abedra/rcov-examples.git

Feel free to browse around and submit any feedback. I am hoping to get as many samples in as possible, so feel free to contribute!


Tuesday, August 11, 2009

Getting Started With Compojure

11 Aug 2009

Compojure is a great web framework written in Clojure. Although in its infancy, the project has a lot of promise. The best part is that getting started is a snap!

The only thing you need to have installed on your system is Java and Ant. Everything else is taken care of for you by Compojure. To make things even simpler I have provided a script that does all of the project setup for you. Let’s take a look.

After you have downloaded the script, make sure to make it executable (chmod +x compojure) then run it:

compojure <project name>

where project name is whatever you want it to be. The script will download Compojure and it’s dependencies, do a fresh build, and copy all of the necessary dependencies for your project into the directory you specified. It will then leave you with a <project name>.clj file that has a “Hello World” example built right in. When the script finishes running just run:

./start

and go to http://localhost:8080. You are now up and running on Compojure! To get a better idea of how to work with Compojure you can check out this site.


Friday, August 7, 2009

Failing Your Builds with RCov

07 Aug 2009

I just pushed the latest bits to RCov, and they include a new option to help you fail in more spectacular ways! Have you ever made sure that your build fails if you don’t satisfy the coverage threshold? If you are in RSpec land, you have always been able to use the built in verify_rcov task, but if you are using any of the other testing frameworks, it has historically been quite a process.

To use the new hotness, simply add --failure-threshold xx where xx is the threshold you want your coverage to be at. If your coverage drops below that threshold you will get a message telling you, but more importantly your build will actually fail. RCov exits non-zero when you fail to satisfy the coverage threshold which means that your Continuous Integration builds will fail. Having this in your bag of tricks is an awesome thing, and can help ensure that everyone is checking in tests along with their code.

To get the latest RCov bits simply run:

gem install relevance-rcov -s http://gems.github.com

You should get at least version 0.8.5. The --failure-threshold option will be included in RCov 0.8.5 and higher. As always, if you have any issues please report them to the RCov issue tracker and I will be sure to take a look. If you are going to submit a bug, check out this tasty groove that will give you some tips on how to properly submit a bug report for RCov. Enjoy your Whales!


Saturday, June 13, 2009

RubyNation Wrapup

13 Jun 2009

RubyNation has been a very nice conference. The quality of talks was excellent as well as the crowd. I got a chance to meet some very cool people and even talk a little bit of Clojure. The slides for my talk on RCov and Ruby 1.9 can be found here.


Items:   1 to 5 of 40   Next »