magic_smoke 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.markdown +15 -0
- data/Rakefile +2 -0
- data/lib/magic_smoke/railtie.rb +10 -0
- data/lib/magic_smoke/version.rb +3 -0
- data/lib/magic_smoke.rb +3 -0
- data/lib/tasks/magic_smoke.rake +41 -0
- data/magic_smoke.gemspec +21 -0
- metadata +65 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.markdown
ADDED
data/Rakefile
ADDED
data/lib/magic_smoke.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require File.expand_path('config/environment', Rails.application.paths.path.to_s)
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
#config
|
5
|
+
CONFIG = <<-DSL
|
6
|
+
|
7
|
+
DSL
|
8
|
+
|
9
|
+
class Routes
|
10
|
+
class << self
|
11
|
+
def all
|
12
|
+
Rails.application.reload_routes!
|
13
|
+
@all ||= Rails.application.routes.routes
|
14
|
+
@all.map { |r| r.path.gsub!("(.:format)", ""); r }
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_requests
|
18
|
+
all.select { |r| r.verb == "GET" || r.verb.blank? }
|
19
|
+
end
|
20
|
+
|
21
|
+
def get_requests_with_no_params
|
22
|
+
get_requests.reject { |r| r.path =~ /:/ }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'A magical smoke test suite'
|
28
|
+
namespace :magic_smoke do
|
29
|
+
|
30
|
+
desc 'Tests all the GET requests with no parameters in your routes'
|
31
|
+
task :routes => :environment do
|
32
|
+
|
33
|
+
puts "Testing GETs..."
|
34
|
+
# ap Routes.get_requests_with_no_params
|
35
|
+
Routes.get_requests_with_no_params.each do |route|
|
36
|
+
response = Rails.application.call(Rack::MockRequest.env_for("http://localhost/#{route.path}"))
|
37
|
+
puts "#{response[0]} #{route.path}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
data/magic_smoke.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "magic_smoke/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "magic_smoke"
|
7
|
+
s.version = MagicSmoke::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Josh Price", "Matt Allen"]
|
10
|
+
s.email = ["josh@canoniq.com", "matt@devlogic.com.au"]
|
11
|
+
s.homepage = "http://github.com/joshprice/magic_smoke"
|
12
|
+
s.summary = %q{A magical smoke test suite for your rails app}
|
13
|
+
s.description = %q{Checks that no routes in your app break}
|
14
|
+
|
15
|
+
s.rubyforge_project = "magic_smoke"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: magic_smoke
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Josh Price
|
9
|
+
- Matt Allen
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
|
14
|
+
date: 2011-06-29 00:00:00 Z
|
15
|
+
dependencies: []
|
16
|
+
|
17
|
+
description: Checks that no routes in your app break
|
18
|
+
email:
|
19
|
+
- josh@canoniq.com
|
20
|
+
- matt@devlogic.com.au
|
21
|
+
executables: []
|
22
|
+
|
23
|
+
extensions: []
|
24
|
+
|
25
|
+
extra_rdoc_files: []
|
26
|
+
|
27
|
+
files:
|
28
|
+
- .gitignore
|
29
|
+
- Gemfile
|
30
|
+
- README.markdown
|
31
|
+
- Rakefile
|
32
|
+
- lib/magic_smoke.rb
|
33
|
+
- lib/magic_smoke/railtie.rb
|
34
|
+
- lib/magic_smoke/version.rb
|
35
|
+
- lib/tasks/magic_smoke.rake
|
36
|
+
- magic_smoke.gemspec
|
37
|
+
homepage: http://github.com/joshprice/magic_smoke
|
38
|
+
licenses: []
|
39
|
+
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: "0"
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "0"
|
57
|
+
requirements: []
|
58
|
+
|
59
|
+
rubyforge_project: magic_smoke
|
60
|
+
rubygems_version: 1.7.2
|
61
|
+
signing_key:
|
62
|
+
specification_version: 3
|
63
|
+
summary: A magical smoke test suite for your rails app
|
64
|
+
test_files: []
|
65
|
+
|