relevance-tarantula 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. data/CHANGELOG +32 -2
  2. data/Rakefile +13 -4
  3. data/VERSION.yml +2 -2
  4. data/examples/example_helper.rb +13 -10
  5. data/examples/relevance/core_extensions/ellipsize_example.rb +1 -1
  6. data/examples/relevance/core_extensions/file_example.rb +1 -1
  7. data/examples/relevance/core_extensions/response_example.rb +1 -1
  8. data/examples/relevance/core_extensions/test_case_example.rb +5 -1
  9. data/examples/relevance/tarantula/attack_form_submission_example.rb +1 -1
  10. data/examples/relevance/tarantula/attack_handler_example.rb +1 -1
  11. data/examples/relevance/tarantula/crawler_example.rb +1 -1
  12. data/examples/relevance/tarantula/form_example.rb +1 -1
  13. data/examples/relevance/tarantula/form_submission_example.rb +1 -1
  14. data/examples/relevance/tarantula/html_document_handler_example.rb +1 -1
  15. data/examples/relevance/tarantula/html_report_helper_example.rb +1 -1
  16. data/examples/relevance/tarantula/html_reporter_example.rb +1 -1
  17. data/examples/relevance/tarantula/invalid_html_handler_example.rb +1 -1
  18. data/examples/relevance/tarantula/io_reporter_example.rb +1 -1
  19. data/examples/relevance/tarantula/link_example.rb +1 -1
  20. data/examples/relevance/tarantula/log_grabber_example.rb +1 -1
  21. data/examples/relevance/tarantula/rails_integration_proxy_example.rb +1 -1
  22. data/examples/relevance/tarantula/result_example.rb +1 -1
  23. data/examples/relevance/tarantula/tidy_handler_example.rb +1 -1
  24. data/examples/relevance/tarantula/transform_example.rb +1 -1
  25. data/examples/relevance/tarantula_example.rb +1 -1
  26. data/lib/relevance/core_extensions/string_chars_fix.rb +11 -0
  27. data/lib/relevance/core_extensions/test_case.rb +8 -1
  28. data/lib/relevance/tarantula.rb +1 -1
  29. data/lib/relevance/tarantula/crawler.rb +2 -0
  30. data/lib/relevance/tarantula/test_report.html.erb +1 -1
  31. metadata +5 -8
  32. data/examples/relevance/tarantula/rails_init_example.rb +0 -14
data/CHANGELOG CHANGED
@@ -1,3 +1,30 @@
1
+ v0.1.6
2
+ * add testing for all Rails versions 2.0.2 and up
3
+ * various clean up and housekeeping tasks;
4
+ * start Ruby 1.9 work (but we need Hpricot)
5
+ * show 50 chars of URL, not 30
6
+ * ensure that ActiveRecord gets loaded correctly for the crawler, so that it can rescue RecordNotFound exceptions
7
+ [Rob Sanheim]
8
+
9
+ v0.1.5 Initial implementation of updated look-and-feel [Erik Yowell] [Jason Rudolph]
10
+
11
+ v0.1.4 Bugfix: Include look-and-feel files when building the gem #16 [Jason Rudolph]
12
+
13
+ v0.1.3 Update list of known static file types (e.g., PDFs) to prevent false reports of 404s for links to files that exist in RAILS_ROOT/public [Aaron Bedra]
14
+
15
+ v0.1.2 Remove dependency on Facets gem [Aaron Bedra]
16
+
17
+ v0.1.1 Bugfix: Add ability to handle anchor tags that lack an href attribute #13 [Kevin Gisi]
18
+
19
+ v0.1.0
20
+ * Improve the generated test template to include inline documentation and make the simple case simple [Jason Rudolph]
21
+ * Update README to better serve first-time users [Jason Rudolph]
22
+ * Update development dependencies declarations [Jason Rudolph]
23
+ * Internal refactorings [Aaron Bedra]
24
+ ** Convert test suite to micronaut
25
+ ** Replace Echoe with Jeweler for gem management
26
+ ** Remove unused code
27
+
1
28
  v0.0.8.1
2
29
  * Fix numerous installation and initial setup issues
3
30
  * Enhance rake tasks to support use of Tarantula in a continuous integration environment
@@ -8,6 +35,9 @@ v0.0.8.1
8
35
  ** Include example of adding a custom attack handler
9
36
  * Simplify design to address concerns about hard-to-read fonts
10
37
 
11
- v0.0.5 Make sure we don't include Relevance::Tarantula into Object - will cause issues Rails dependencies and is a bad idea in general; update Rakefile for dev dependencies; another small clean up tasks
38
+ v0.0.5
39
+ * Make sure we don't include Relevance::Tarantula into Object - will cause issues with Rails dependencies and is a bad idea in general
40
+ * Update Rakefile for development dependencies
41
+ * Other small clean up tasks
12
42
 
13
- v0.0.1 Tarantula becomes a gem. (Aaron Bedra)
43
+ v0.0.1 Tarantula becomes a gem. [Aaron Bedra]
data/Rakefile CHANGED
@@ -1,9 +1,7 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
3
  require 'rake/rdoctask'
4
- require 'rcov/rcovtask'
5
- require 'rubygems'
6
- gem "spicycode-micronaut", ">= 0.2.0"
4
+ gem "spicycode-micronaut", ">= 0.2.4"
7
5
  require 'micronaut'
8
6
  require 'micronaut/rake_task'
9
7
  require 'lib/relevance/tarantula.rb'
@@ -48,6 +46,17 @@ namespace :examples do
48
46
  t.rcov = true
49
47
  t.rcov_opts = %[--exclude "gems/*,/Library/Ruby/*,config/*" --text-summary --sort coverage --no-validator-links]
50
48
  end
49
+
50
+ RAILS_VERSIONS = %w[2.0.2 2.1.0 2.1.1 2.2.2 2.3.1]
51
+
52
+ desc "Run exmaples with multiple versions of rails"
53
+ task :multi_rails do
54
+ RAILS_VERSIONS.each do |rails_version|
55
+ puts
56
+ sh "RAILS_VERSION='#{rails_version}' rake examples"
57
+ end
58
+ end
59
+
51
60
  end
52
61
 
53
- task :default => "examples"
62
+ task :default => "examples"
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 5
3
- :major: 0
4
2
  :minor: 1
3
+ :patch: 6
4
+ :major: 0
@@ -1,27 +1,30 @@
1
1
  lib_path = File.expand_path(File.dirname(__FILE__) + "/../lib")
2
2
  $LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
3
3
 
4
- require 'rubygems'
5
- gem "spicycode-micronaut", ">= 0.2.0"
4
+ gem "spicycode-micronaut", ">= 0.2.4"
6
5
  gem "log_buddy"
7
6
  gem "mocha"
8
- gem 'ruby-debug'
9
- gem 'test-spec'
7
+ if rails_version = ENV['RAILS_VERSION']
8
+ gem "rails", rails_version
9
+ end
10
+ require "rails/version"
11
+ if Rails::VERSION::STRING < "2.3.1" && RUBY_VERSION >= "1.9.1"
12
+ puts "Tarantula requires Rails 2.3.1 or higher for Ruby 1.9 support"
13
+ exit(1)
14
+ end
15
+ puts "==== Testing with Rails #{Rails::VERSION::STRING} ===="
10
16
  gem 'actionpack'
11
17
  gem 'activerecord'
12
18
  gem 'activesupport'
13
19
 
14
20
  require 'ostruct'
15
- require 'ruby-debug'
16
- require 'activerecord'
21
+ require 'active_support'
22
+ require 'action_controller'
23
+ require 'active_record'
17
24
  require 'relevance/tarantula'
18
25
  require 'micronaut'
19
26
  require 'mocha'
20
27
 
21
- # needed for html-scanner, grr
22
- require 'active_support'
23
- require 'action_controller'
24
-
25
28
  def test_output_dir
26
29
  File.join(File.dirname(__FILE__), "..", "tmp", "test_output")
27
30
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "../..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "../..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::CoreExtensions::Object#ellipsize" do
4
4
  it "converts nil to empty string" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "../..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "../..", "example_helper.rb"))
2
2
  require 'relevance/core_extensions/file'
3
3
 
4
4
  describe "Relevance::CoreExtensions::File#extension" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "../..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "../..", "example_helper.rb"))
2
2
  require 'relevance/core_extensions/file'
3
3
 
4
4
  describe "Relevance::CoreExtensions::Response#html?" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "../..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "../..", "example_helper.rb"))
2
2
  require 'relevance/core_extensions/test_case'
3
3
 
4
4
  describe "TestCase extensions" do
@@ -13,4 +13,8 @@ describe "TestCase extensions" do
13
13
  expects(:tarantula_crawler).returns(crawler)
14
14
  tarantula_crawl(:integration_test_stub, :url => "/foo")
15
15
  end
16
+
17
+ it "should get mixed into ActionController::IntegrationTest" do
18
+ ActionController::IntegrationTest.ancestors.should include(Relevance::CoreExtensions::TestCaseExtensions)
19
+ end
16
20
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::Tarantula::AttackFormSubmission" do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::Tarantula::AttackHandler" do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe 'Relevance::Tarantula::Crawler#transform_url' do
4
4
  before {@crawler = Relevance::Tarantula::Crawler.new}
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::Tarantula::Form large example" do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::Tarantula::FormSubmission" do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::Tarantula::HtmlDocumentHandler" do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  module HtmlReportHelperSpec
4
4
  # Is there an idiom for this?
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::Tarantula::HtmlReporter file output" do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::Tarantula::InvalidHtmlHandler" do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe 'Relevance::Tarantula::IOReporter' do
4
4
  it "reports errors to stderr and then raises" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::Tarantula::Link" do
4
4
  include ActionView::Helpers::UrlHelper
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe 'Relevance::Tarantula::LogGrabber' do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::Tarantula::RailsIntegrationProxy rails_integration_test" do
4
4
  before {
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::Tarantula::Result" do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb"))
2
2
 
3
3
  if defined?(Tidy) && ENV['TIDY_PATH']
4
4
  describe "Relevance::Tarantula::TidyHandler default" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "../..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "../..", "example_helper.rb"))
2
2
 
3
3
  describe "Relevance::Tarantula::Transform" do
4
4
  it "can do a simple replace" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "example_helper.rb")
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "example_helper.rb"))
2
2
 
3
3
  describe Relevance::Tarantula do
4
4
  include Relevance::Tarantula
@@ -0,0 +1,11 @@
1
+ if RUBY_VERSION == "1.8.7" # fix interaction between Ruby 187 and Rails 202, so we can at least run the test suite on that combination
2
+ unless '1.9'.respond_to?(:force_encoding)
3
+ String.class_eval do
4
+ begin
5
+ remove_method :chars
6
+ rescue NameError
7
+ # OK
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,4 +1,7 @@
1
- class Test::Unit::TestCase
1
+ require 'action_controller/integration'
2
+
3
+ module Relevance::CoreExtensions::TestCaseExtensions
4
+
2
5
  def tarantula_crawl(integration_test, options = {})
3
6
  url = options[:url] || "/"
4
7
  t = tarantula_crawler(integration_test, options)
@@ -8,5 +11,9 @@ class Test::Unit::TestCase
8
11
  def tarantula_crawler(integration_test, options = {})
9
12
  Relevance::Tarantula::RailsIntegrationProxy.rails_integration_test(integration_test, options)
10
13
  end
14
+
11
15
  end
12
16
 
17
+ if defined? ActionController::IntegrationTest
18
+ ActionController::IntegrationTest.class_eval { include Relevance::CoreExtensions::TestCaseExtensions }
19
+ end
@@ -2,7 +2,6 @@ TARANTULA_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "../.."))
2
2
 
3
3
  require 'forwardable'
4
4
  require 'erb'
5
- require 'rubygems'
6
5
  require 'active_support'
7
6
  require 'action_controller'
8
7
 
@@ -38,6 +37,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), "core_extensions", "e
38
37
  require File.expand_path(File.join(File.dirname(__FILE__), "core_extensions", "file"))
39
38
  require File.expand_path(File.join(File.dirname(__FILE__), "core_extensions", "response"))
40
39
  require File.expand_path(File.join(File.dirname(__FILE__), "core_extensions", "metaclass"))
40
+ require File.expand_path(File.join(File.dirname(__FILE__), "core_extensions", "string_chars_fix"))
41
41
 
42
42
  require File.expand_path(File.join(File.dirname(__FILE__), "tarantula", "html_reporter"))
43
43
  require File.expand_path(File.join(File.dirname(__FILE__), "tarantula", "html_report_helper"))
@@ -1,3 +1,5 @@
1
+ require 'active_record'
2
+ require 'active_record/base'
1
3
  require File.expand_path(File.join(File.dirname(__FILE__), "rails_integration_proxy"))
2
4
  require File.expand_path(File.join(File.dirname(__FILE__), "html_document_handler.rb"))
3
5
 
@@ -18,7 +18,7 @@
18
18
  <tbody>
19
19
  <% send(result_type).sort{|x,y| y.code.to_s <=> x.code.to_s}.each_with_index do |result,i| %>
20
20
  <tr class="<%= (i%2 == 0) ? 'even' : 'odd' %>">
21
- <td class="left"><a href="<%= "#{test_name}/#{result.file_name}" %>"><%= result.url.ellipsize(30) %></a></td>
21
+ <td class="left"><a href="<%= "#{test_name}/#{result.file_name}" %>"><%= result.url.ellipsize(50) %></a></td>
22
22
  <td class="method"><%= result.method.to_s.upcase %></td> <!-- TODO Clean up demeter violation -->
23
23
  <td><span class="<%= class_for_code(result.code) %>"><%= result.code %></span></td>
24
24
  <td class="left"><%= result.description %></td>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relevance-tarantula
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Relevance, Inc.
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-20 00:00:00 -08:00
12
+ date: 2009-03-11 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -19,8 +19,8 @@ executables: []
19
19
 
20
20
  extensions: []
21
21
 
22
- extra_rdoc_files: []
23
-
22
+ extra_rdoc_files:
23
+ - README.rdoc
24
24
  files:
25
25
  - CHANGELOG
26
26
  - MIT-LICENSE
@@ -47,12 +47,8 @@ files:
47
47
  - examples/relevance/tarantula/io_reporter_example.rb
48
48
  - examples/relevance/tarantula/link_example.rb
49
49
  - examples/relevance/tarantula/log_grabber_example.rb
50
- - examples/relevance/tarantula/rails_init_example.rb
51
50
  - examples/relevance/tarantula/rails_integration_proxy_example.rb
52
51
  - examples/relevance/tarantula/result_example.rb
53
- - examples/relevance/tarantula/STUB_RAILS_ROOT
54
- - examples/relevance/tarantula/STUB_RAILS_ROOT/tmp
55
- - examples/relevance/tarantula/STUB_RAILS_ROOT/tmp/tarantula
56
52
  - examples/relevance/tarantula/tidy_handler_example.rb
57
53
  - examples/relevance/tarantula/transform_example.rb
58
54
  - examples/relevance/tarantula_example.rb
@@ -91,6 +87,7 @@ files:
91
87
  - lib/relevance/core_extensions/file.rb
92
88
  - lib/relevance/core_extensions/metaclass.rb
93
89
  - lib/relevance/core_extensions/response.rb
90
+ - lib/relevance/core_extensions/string_chars_fix.rb
94
91
  - lib/relevance/core_extensions/test_case.rb
95
92
  - lib/relevance/tarantula
96
93
  - lib/relevance/tarantula/attack.rb
@@ -1,14 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "../..", "example_helper.rb")
2
-
3
- describe "Rails init.rb" do
4
- after { ENV.delete "RAILS_ENV" }
5
-
6
- pending "requires main tarantula file if in test environment" do
7
- ENV["RAILS_ENV"] = "test"
8
- path = File.expand_path(File.join(File.dirname(__FILE__), *%w[.. .. .. lib relevance tarantula]))
9
- Object.any_instance.expects(:require).with('rake')
10
- Object.any_instance.expects(:require).with path
11
- load File.expand_path(File.join(File.dirname(__FILE__), *%w[.. .. .. rails init.rb]))
12
- end
13
-
14
- end