Fingertips-on-test-spec 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 2
4
- :patch: 1
4
+ :patch: 2
@@ -0,0 +1,11 @@
1
+ module Test
2
+ module Spec
3
+ module Rails
4
+ module ControllerHelpers
5
+ attr_reader :controller
6
+ end
7
+ end
8
+ end
9
+ end
10
+
11
+ ActionController::TestCase.send(:include, Test::Spec::Rails::ControllerHelpers)
@@ -1,10 +1,15 @@
1
1
  require File.expand_path('../test_helper', __FILE__)
2
2
  require 'test/spec/rails/request_helpers'
3
3
  require 'test/spec/rails/response_helpers'
4
+ require 'test/spec/rails/controller_helpers'
4
5
 
5
6
  class ActionControllerClass < ActionController::Base; end
6
7
 
7
8
  describe ActionControllerClass, "response helpers for a controller test" do
9
+ it "should map #controller to the controller instance" do
10
+ controller.should == @controller
11
+ end
12
+
8
13
  it "should map #status to the response status" do
9
14
  expects(:assert_response).with(:success, 'the message')
10
15
  status.should.be :success, 'the message'
@@ -70,6 +70,7 @@ end
70
70
 
71
71
  describe "Differ expectations" do
72
72
  include AssertionAssertions
73
+ attr_accessor :controller
73
74
 
74
75
  before do
75
76
  TestingAssertionsThemselves.assertions = []
@@ -182,6 +183,7 @@ end
182
183
 
183
184
  describe "NotDiffer expectations" do
184
185
  include AssertionAssertions
186
+ attr_accessor :controller
185
187
 
186
188
  before do
187
189
  TestingAssertionsThemselves.assertions = []
@@ -274,6 +276,7 @@ end
274
276
 
275
277
  describe "Record expectations" do
276
278
  include AssertionAssertions
279
+ attr_accessor :controller
277
280
 
278
281
  before do
279
282
  TestingAssertionsThemselves.assertions = []
@@ -410,8 +413,7 @@ end
410
413
 
411
414
  describe "Redirection expectations" do
412
415
  include AssertionAssertions
413
-
414
- attr_reader :controller
416
+ attr_accessor :controller
415
417
 
416
418
  before do
417
419
  TestingAssertionsThemselves.assertions = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Fingertips-on-test-spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manfred Stienstra
@@ -25,14 +25,13 @@ extra_rdoc_files:
25
25
  - LICENSE
26
26
  - README
27
27
  files:
28
- - .gitignore
29
28
  - LICENSE
30
29
  - README
31
30
  - Rakefile
32
31
  - VERSION.yml
33
- - dot.autotest
34
32
  - lib/test/spec/add_allow_switch.rb
35
33
  - lib/test/spec/rails.rb
34
+ - lib/test/spec/rails/controller_helpers.rb
36
35
  - lib/test/spec/rails/expectations.rb
37
36
  - lib/test/spec/rails/macros.rb
38
37
  - lib/test/spec/rails/macros/authorization.rb
@@ -41,7 +40,6 @@ files:
41
40
  - lib/test/spec/rails/spec_responder.rb
42
41
  - lib/test/spec/rails/test_spec_ext.rb
43
42
  - lib/test/spec/share.rb
44
- - on-test-spec.gemspec
45
43
  - test/add_allow_switch_test.rb
46
44
  - test/controller_helpers_test.rb
47
45
  - test/expectations_test.rb
data/.gitignore DELETED
@@ -1 +0,0 @@
1
- pkg/
data/dot.autotest DELETED
@@ -1,93 +0,0 @@
1
- Autotest.add_hook :initialize do |at|
2
- at.unit_diff = 'cat'
3
- at.failed_results_re = /^\s+\d+\) (?:Failure|Error):\n(.*?)\((.*?)\)\n\[([^:]*):.*\]/
4
-
5
- at.add_exception %r%^\./(?:db|doc|log|public|script|tmp|vendor|data|content|config)%
6
- at.add_exception %r%\.svn%
7
-
8
- at.clear_mappings
9
-
10
- # Add your custom mappings:
11
- #
12
- # at.add_mapping %r%^app/(concerns)/(.*)\.rb$% do |_, match|
13
- # "test/unit/#{match[1]}/#{match[2]}_test.rb"
14
- # end
15
- #
16
- # at.add_mapping %r%^test/unit/(concerns)/.*rb$% do |filename, _|
17
- # filename
18
- # end
19
- #
20
- # at.add_mapping %r%^lib/(.*).rb% do |_, match|
21
- # sqwat = match[1].gsub('/', '_')
22
- # "test/lib/#{sqwat}_test.rb"
23
- # end
24
- #
25
- # at.add_mapping %r%^test/lib/.*rb$% do |filename, _|
26
- # filename
27
- # end
28
-
29
- # Standard Rails
30
-
31
- at.add_mapping %r%^test/fixtures/(.*)s.yml% do |_, m|
32
- ["test/unit/#{m[1]}_test.rb",
33
- "test/controllers/#{m[1]}_controller_test.rb",
34
- "test/views/#{m[1]}_view_test.rb",
35
- "test/functional/#{m[1]}_controller_test.rb"]
36
- end
37
-
38
- at.add_mapping %r%^test/(unit|integration|controllers|views|functional|helpers)/.*rb$% do |filename, _|
39
- filename
40
- end
41
-
42
- at.add_mapping %r%^app/models/(.*)\.rb$% do |_, m|
43
- "test/unit/#{m[1]}_test.rb"
44
- end
45
-
46
- at.add_mapping %r%^app/helpers/application_helper.rb% do
47
- ["test/helpers/applications_helper_test.rb"] + at.files_matching(%r%^test/(views|functional)/.*_test\.rb$%)
48
- end
49
-
50
- at.add_mapping %r%^app/helpers/(.*)_helper.rb% do |_, m|
51
- if m[1] == "application" then
52
- at.files_matching %r%^test/(views|functional)/.*_test\.rb$%
53
- else
54
- ["test/helpers/#{m[1]}_helper_test.rb",
55
- "test/views/#{m[1]}_view_test.rb",
56
- "test/functional/#{m[1]}_controller_test.rb"]
57
- end
58
- end
59
-
60
- at.add_mapping %r%^app/views/(.*)/% do |_, m|
61
- ["test/views/#{m[1]}_view_test.rb",
62
- "test/functional/#{m[1]}_controller_test.rb"]
63
- end
64
-
65
- at.add_mapping %r%^app/controllers/(.*)\.rb$% do |_, m|
66
- if m[1] == "application" then
67
- at.files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
68
- else
69
- ["test/controllers/#{m[1]}_test.rb",
70
- "test/functional/#{m[1]}_test.rb"]
71
- end
72
- end
73
-
74
- at.add_mapping %r%^app/views/layouts/% do
75
- "test/views/layouts_view_test.rb"
76
- end
77
-
78
- at.add_mapping %r%^config/routes.rb$% do
79
- at.files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
80
- end
81
-
82
- at.add_mapping %r%^test/test_helper.rb|config/((boot|environment(s/test)?).rb|database.yml)% do
83
- at.files_matching %r%^test/(unit|controllers|views|functional)/.*_test\.rb$%
84
- end
85
-
86
- class << at
87
- def consolidate_failures(failed)
88
- failed.inject(new_hash_of_arrays) do |filters, (method, klass, filename)|
89
- filters[File.expand_path(filename)] << method; filters
90
- end
91
- end
92
- end
93
- end
data/on-test-spec.gemspec DELETED
@@ -1,72 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{on-test-spec}
8
- s.version = "0.2.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Manfred Stienstra", "Eloy Duran", "Cristi Balan"]
12
- s.date = %q{2009-09-21}
13
- s.description = %q{Rails plugin to make testing Rails on test/spec easier.}
14
- s.email = %q{eloy.de.enige@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README"
18
- ]
19
- s.files = [
20
- ".gitignore",
21
- "LICENSE",
22
- "README",
23
- "Rakefile",
24
- "VERSION.yml",
25
- "dot.autotest",
26
- "lib/test/spec/add_allow_switch.rb",
27
- "lib/test/spec/rails.rb",
28
- "lib/test/spec/rails/expectations.rb",
29
- "lib/test/spec/rails/macros.rb",
30
- "lib/test/spec/rails/macros/authorization.rb",
31
- "lib/test/spec/rails/request_helpers.rb",
32
- "lib/test/spec/rails/response_helpers.rb",
33
- "lib/test/spec/rails/spec_responder.rb",
34
- "lib/test/spec/rails/test_spec_ext.rb",
35
- "lib/test/spec/share.rb",
36
- "on-test-spec.gemspec",
37
- "test/add_allow_switch_test.rb",
38
- "test/controller_helpers_test.rb",
39
- "test/expectations_test.rb",
40
- "test/macros/authorization_test.rb",
41
- "test/macros/base_test.rb",
42
- "test/rails_test.rb",
43
- "test/share_test.rb",
44
- "test/test_helper.rb"
45
- ]
46
- s.has_rdoc = true
47
- s.homepage = %q{http://github.com/Fingertips/on-test-spec}
48
- s.rdoc_options = ["--charset=UTF-8"]
49
- s.require_paths = ["lib"]
50
- s.rubygems_version = %q{1.3.1}
51
- s.summary = %q{Rails plugin to make testing Rails on test/spec easier.}
52
- s.test_files = [
53
- "test/add_allow_switch_test.rb",
54
- "test/controller_helpers_test.rb",
55
- "test/expectations_test.rb",
56
- "test/macros/authorization_test.rb",
57
- "test/macros/base_test.rb",
58
- "test/rails_test.rb",
59
- "test/share_test.rb",
60
- "test/test_helper.rb"
61
- ]
62
-
63
- if s.respond_to? :specification_version then
64
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
65
- s.specification_version = 2
66
-
67
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
68
- else
69
- end
70
- else
71
- end
72
- end