protest 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  (The MIT License)
2
2
 
3
3
  Copyright (c) 2009 Nicolas Sanguinetti
4
+ Copyright (c) 2010 Matías Flores
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining
6
7
  a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ Protest.
30
30
 
31
31
  Or
32
32
 
33
- rip install git://github.com/matflores/protest.git v0.3.0
33
+ rip install git://github.com/matflores/protest.git v0.4.0
34
34
 
35
35
  == Setup and teardown
36
36
 
@@ -222,6 +222,10 @@ register your subclass by calling +Protest.add_report+. See the
222
222
  documentation for details, or take a look at the source code for
223
223
  Protest::Reports::Progress and Protest::Reports::Documentation.
224
224
 
225
+ == Using Rails?
226
+
227
+ If you are using Rails you may want to take a look at http://github.com/matflores/protest-rails.
228
+
225
229
  == Legal
226
230
 
227
231
  Maintainer:: Matías Flores — http://matflores.com
@@ -1,5 +1,5 @@
1
1
  module Protest
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
3
3
 
4
4
  # Exception raised when an assertion fails. See TestCase#assert
5
5
  class AssertionFailed < StandardError; end
@@ -1,7 +1,8 @@
1
+ # -*- coding: utf-8 -*-
1
2
  Gem::Specification.new do |s|
2
3
  s.name = "protest"
3
- s.version = "0.3.2"
4
- s.date = "2010-07-27"
4
+ s.version = "0.4.0"
5
+ s.date = "2010-09-01"
5
6
 
6
7
  s.description = "Protest is a tiny, simple, and easy-to-extend test framework"
7
8
  s.summary = s.description
@@ -38,6 +39,5 @@ lib/protest/reports/summary.rb
38
39
  lib/protest/reports/turn.rb
39
40
  lib/protest/reports/stories.rb
40
41
  lib/protest/reports/stories/pdf.rb
41
- lib/protest/rails.rb
42
42
  ]
43
43
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protest
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 15
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
- - 3
8
- - 2
9
- version: 0.3.2
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - "Nicol\xC3\xA1s Sanguinetti"
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-07-27 00:00:00 -03:00
19
+ date: 2010-09-01 00:00:00 -03:00
19
20
  default_executable:
20
21
  dependencies: []
21
22
 
@@ -50,7 +51,6 @@ files:
50
51
  - lib/protest/reports/turn.rb
51
52
  - lib/protest/reports/stories.rb
52
53
  - lib/protest/reports/stories/pdf.rb
53
- - lib/protest/rails.rb
54
54
  has_rdoc: true
55
55
  homepage: http://matflores.github.com/protest
56
56
  licenses: []
@@ -61,23 +61,27 @@ rdoc_options: []
61
61
  require_paths:
62
62
  - lib
63
63
  required_ruby_version: !ruby/object:Gem::Requirement
64
+ none: false
64
65
  requirements:
65
66
  - - ">="
66
67
  - !ruby/object:Gem::Version
68
+ hash: 3
67
69
  segments:
68
70
  - 0
69
71
  version: "0"
70
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
+ none: false
71
74
  requirements:
72
75
  - - ">="
73
76
  - !ruby/object:Gem::Version
77
+ hash: 3
74
78
  segments:
75
79
  - 0
76
80
  version: "0"
77
81
  requirements: []
78
82
 
79
83
  rubyforge_project: protest
80
- rubygems_version: 1.3.6
84
+ rubygems_version: 1.3.7
81
85
  signing_key:
82
86
  specification_version: 3
83
87
  summary: Protest is a tiny, simple, and easy-to-extend test framework
@@ -1,80 +0,0 @@
1
- require "protest"
2
- require "test/unit/assertions"
3
- require "action_controller/test_case"
4
-
5
- begin
6
- require "webrat"
7
- rescue LoadError
8
- $no_webrat = true
9
- end
10
-
11
- module Protest
12
- module Rails
13
- # Exclude rails' files from the errors
14
- class BacktraceFilter < Utils::BacktraceFilter
15
- include ::Rails::BacktraceFilterForTestUnit
16
-
17
- def filter_backtrace(backtrace, prefix=nil)
18
- super(backtrace, prefix).reject do |line|
19
- line.starts_with?("/")
20
- end
21
- end
22
- end
23
-
24
- # Wrap all tests in a database transaction.
25
- #
26
- # TODO: make this optional somehow (yet enabled by default) so users of
27
- # other ORMs don't run into problems.
28
- module TransactionalTests
29
- def run(*args, &block)
30
- ActiveRecord::Base.connection.transaction do
31
- super(*args, &block)
32
- raise ActiveRecord::Rollback
33
- end
34
- end
35
- end
36
-
37
- # You should inherit from this TestCase in order to get rails' helpers
38
- # loaded into Protest. These include all the assertions bundled with rails
39
- # and your tests being wrapped in a transaction.
40
- class TestCase < ::Protest::TestCase
41
- include ::Test::Unit::Assertions
42
- include ActiveSupport::Testing::Assertions
43
- include TransactionalTests
44
- end
45
-
46
- class RequestTest < TestCase #:nodoc:
47
- %w(response selector tag dom routing model).each do |kind|
48
- include ActionController::Assertions.const_get("#{kind.camelize}Assertions")
49
- end
50
- end
51
-
52
- # Make your integration tests inherit from this class, which bundles the
53
- # integration runner included with rails, and webrat's test methods. You
54
- # should use webrat for integration tests. Really.
55
- class IntegrationTest < RequestTest
56
- include ActionController::Integration::Runner
57
- include Webrat::Methods unless $no_webrat
58
- end
59
- end
60
-
61
- # The preferred way to declare a context (top level) is to use
62
- # +Protest.describe+ or +Protest.context+, which will ensure you're using
63
- # rails adapter with the helpers you need.
64
- def self.context(description, &block)
65
- Rails::TestCase.context(description, &block)
66
- end
67
-
68
- # Use +Protest.story+ to declare an integration test for your rails app. Note
69
- # that the files should still be called 'test/integration/foo_test.rb' if you
70
- # want the 'test:integration' rake task to pick them up.
71
- def self.story(description, &block)
72
- Rails::IntegrationTest.story(description, &block)
73
- end
74
-
75
- class << self
76
- alias_method :describe, :context
77
- end
78
-
79
- self.backtrace_filter = Rails::BacktraceFilter.new
80
- end