Take the 2008 Git User's Survey and help out! [ hide ]

public
Description: gem / Rails plugin, generate a report detailing duplicate lines in your ruby project with outputs for TextMate, Netbeans and also in HTML
Homepage: http://21croissants.blogspot.com/2008/03/dry.html
Clone URL: git://github.com/garnierjm/dry-report.git
Search Repo:
Click here to lend your support to: dry-report and make a donation at www.pledgie.com !
Jean-Michel Garnier (author)
Tue Aug 05 08:58:27 -0700 2008
dry-report / rails_plugin / vendor / plugins / dont_repeat_yourself / spec / test_unit_extension_spec.rb
100644 28 lines (22 sloc) 0.913 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require File.dirname(__FILE__) + '/spec_helper'
require 'test/unit'
 
describe "Test::Unit extension" do
    
# TODO How to intercept failure???
# it "should have assert_DRY" do
# assert_DRY(rails_application.with_netbeans_reporting)
# end
 
  it "should have a custom expectation matcher be_DRY" do
    assert_DRY(ruby_code_in_rails_plugin("dont_repeat_yourself"))
  end
    
  it "should use a fluent interface with a RSpec matcher which returns itself so we can specify: with_threshold_of_duplicate_lines" do
    assert_DRY(
      ruby_code_in_rails_plugin("dont_repeat_yourself").
        with_threshold_of_duplicate_lines(2))
  end
  
  it "should use a fluent interface so we can specify: with_netbeans_reporting" do
    assert_DRY(
      ruby_code_in_rails_plugin("dont_repeat_yourself").
        with_threshold_of_duplicate_lines(2).
        with_netbeans_reporting)
  end
      
end