rspec-autotest 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6d1b32eb5df6ca7744e2cb5d268e8daa485cec73fab8f898aafecefb2a85b062
4
+ data.tar.gz: 2c4993a31146768669f9d271cb3a4e8d8581aff894a2c2467aadf2e0c417d661
5
+ SHA512:
6
+ metadata.gz: a36ccbc37d9dfb785eb769d95890b5a78961935b72aa0fdf89066ac4ec5d7f8104738ecac02569f33d458b68e5476a7658146a7662be6acd0feb368a03e86309
7
+ data.tar.gz: db4281723466b7e376455aa6924a0e13500fe1f752e25c39796a65613d358a73cee7eceb9a29fdec3600a541b54773807a303aac2da89812d44ae35a0f9e2126
data/.travis.yml CHANGED
@@ -1,13 +1,18 @@
1
1
  language: ruby
2
2
  script: "script/test_all 2>&1"
3
3
  bundler_args: "--standalone --binstubs"
4
+ before_install:
5
+ - gem update --system
6
+ - gem update bundler
4
7
  rvm:
5
8
  - 1.8.7
6
9
  - ree
7
10
  - 1.9.2
8
11
  - 1.9.3
9
12
  - 2.0.0
10
- - 2.1.2
13
+ - 2.1
14
+ - 2.2
15
+ - 2.3
11
16
  - jruby-18mode
12
17
  - jruby-19mode
13
18
  - rbx-2
data/Gemfile CHANGED
@@ -21,4 +21,8 @@ platforms :ruby do
21
21
  gem 'github-markup', '0.7.2'
22
22
  end
23
23
 
24
+ if RUBY_VERSION.to_s < '1.9.3'
25
+ gem 'i18n', '~> 0.6.0'
26
+ end
27
+
24
28
  eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom')
data/README.md CHANGED
@@ -1,10 +1,11 @@
1
- # rspec-autotest [![Build Status](https://secure.travis-ci.org/rspec/rspec-autotest.png?branch=master)](http://travis-ci.org/rspec/rspec-autotest) [![Code Climate](https://codeclimate.com/github/rspec/rspec-autotest.png)](https://codeclimate.com/github/rspec/rspec-autotest) [![Coverage Status](https://coveralls.io/repos/rspec/rspec-autotest/badge.png?branch=master)](https://coveralls.io/r/rspec/rspec-autotest?branch=master)
1
+ # rspec-autotest [![Build Status](https://secure.travis-ci.org/rspec/rspec-autotest.svg?branch=master)](http://travis-ci.org/rspec/rspec-autotest) [![Code Climate](https://codeclimate.com/github/rspec/rspec-autotest.svg)](https://codeclimate.com/github/rspec/rspec-autotest) [![Coverage Status](https://coveralls.io/repos/rspec/rspec-autotest/badge.png?branch=master)](https://coveralls.io/r/rspec/rspec-autotest?branch=master)
2
2
 
3
- rspec-autotest provides integration between autotest and RSpec
3
+ `rspec-autotest` provides integration between autotest and RSpec; Autotest is not included
4
+ in this gem and can be installed via the `autotest-standalone` or `zentest` gems.
4
5
 
5
6
  ## Usage
6
7
 
7
- RSpec ships with a specialized subclass of Autotest. To use it, just add a
8
+ RSpec Autotest ships with a specialized subclass of Autotest. To use it, just add a
8
9
  `.rspec` file to your project's root directory, and run the `autotest` command
9
10
  as normal:
10
11
 
@@ -34,6 +35,20 @@ generate rspec:install` command.
34
35
 
35
36
  ## Gotchas
36
37
 
38
+ ### Autotest style autotest/rspec_rspec2 doesn't seem to exist. Aborting.
39
+
40
+ This happens if you're using rspec-3.x + rspec-autotest-1.x and you
41
+ still have rspec-core-2.x installed. You have two options to resolve this issue:
42
+
43
+ 1. Uninstall rspec-core-2.x (or remove it from the current gemset if you use a
44
+ tool that supports gemsets).
45
+ 1. Pass a `--style` flag to the `autotest` executable, which should resolve the
46
+ version of rspec correctly to 3.x:
47
+
48
+ ```shell
49
+ autotest --style rspec
50
+ ```
51
+
37
52
  ### Invalid Option: --tty
38
53
 
39
54
  The `--tty` option was [added in rspec-core-2.2.1](changelog), and is used
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Autotest
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
@@ -22,7 +22,8 @@
22
22
 
23
23
  $:.push(*Dir['vendor/rails/*/lib'])
24
24
 
25
- require 'active_support/core_ext'
25
+ require 'active_support'
26
+ require 'active_support/all'
26
27
  require 'autotest/rspec'
27
28
 
28
29
  class Autotest
@@ -52,7 +53,7 @@ class Autotest
52
53
  files_matching %r{\Aspec/views/#{m[1]}_spec.rb\z}
53
54
  }
54
55
  add_mapping(%r{\Aapp/controllers/(.*)\.rb\z}) { |_, m|
55
- if m[1] == 'application'
56
+ if m[1] == 'application_controller'
56
57
  files_matching %r{\Aspec/controllers/.*_spec\.rb\z}
57
58
  else
58
59
  ["spec/controllers/#{m[1]}_spec.rb"]
@@ -12,8 +12,6 @@ Gem::Specification.new do |spec|
12
12
  spec.description = 'RSpec Autotest integration'
13
13
  spec.license = 'MIT'
14
14
 
15
- spec.rubyforge_project = 'rspec'
16
-
17
15
  spec.files = `git ls-files`.split($/)
18
16
  spec.test_files = spec.files.grep(%r{^spec/})
19
17
  spec.rdoc_options = ['--charset=UTF-8']
@@ -24,7 +22,11 @@ Gem::Specification.new do |spec|
24
22
  spec.add_dependency 'rspec-core', '>= 2.99.0.beta1', '< 4.0.0'
25
23
 
26
24
  spec.add_development_dependency 'bundler', '>= 1.3'
27
- spec.add_development_dependency 'rake', '>= 10.0.0'
25
+ if RUBY_VERSION.to_f > 1.9
26
+ spec.add_development_dependency 'rake', '>= 10.0.0'
27
+ else
28
+ spec.add_development_dependency 'rake', '~> 10.0'
29
+ end
28
30
  spec.add_development_dependency 'ZenTest', '>= 4.6'
29
31
  spec.add_development_dependency 'activesupport', '~> 3.0'
30
32
  end
@@ -25,11 +25,145 @@ describe Autotest::RailsRspec do
25
25
  end
26
26
 
27
27
  describe 'mappings' do
28
+ before do
29
+ rails_rspec_autotest.find_order = %w(spec/models/admin_spec.rb spec/models/user_spec.rb spec/support/blueprints.rb spec/views/users/index_spec.rb)
30
+ end
31
+
28
32
  it 'runs model specs when support files change' do
29
- rails_rspec_autotest.find_order = %w(spec/models/user_spec.rb spec/support/blueprints.rb)
30
33
  expect(rails_rspec_autotest.test_files_for('spec/support/blueprints.rb')).to(
31
34
  include('spec/models/user_spec.rb'))
32
35
  end
36
+
37
+ it 'runs model spec when source file changes' do
38
+ expect(rails_rspec_autotest.test_files_for('spec/models/user_spec.rb')).to eq(
39
+ %w(spec/models/user_spec.rb))
40
+ end
41
+
42
+ describe 'when controllers exist' do
43
+ before do
44
+ rails_rspec_autotest.find_order = %w(spec/controllers/admin_controller_spec.rb spec/controllers/unconstrained_spec.rb spec/controllers/users_controller_spec.rb)
45
+ end
46
+
47
+ describe 'for default controller' do
48
+ it 'finds all controller specs' do
49
+ expect(rails_rspec_autotest.test_files_for('app/controllers/application_controller.rb')).to eq(
50
+ %w(spec/controllers/admin_controller_spec.rb spec/controllers/unconstrained_spec.rb spec/controllers/users_controller_spec.rb)
51
+ )
52
+ end
53
+
54
+ it 'finds unconventionally named specs' do
55
+ expect(rails_rspec_autotest.test_files_for('app/controllers/application_controller.rb')).to(
56
+ include('spec/controllers/unconstrained_spec.rb'))
57
+ end
58
+ end
59
+
60
+ it 'finds specific controller spec' do
61
+ expect(rails_rspec_autotest.test_files_for('app/controllers/users_controller.rb')).to eq(
62
+ %w(spec/controllers/users_controller_spec.rb)
63
+ )
64
+ end
65
+ end
66
+
67
+ describe 'when fixtures exist' do
68
+ it 'finds associated model specs' do
69
+ expect(rails_rspec_autotest.test_files_for('spec/fixtures/users.yml')).to(
70
+ include('spec/models/user_spec.rb'))
71
+ end
72
+
73
+ it 'finds associated view specs' do
74
+ expect(rails_rspec_autotest.test_files_for('spec/fixtures/users.yml')).to(
75
+ include('spec/views/users/index_spec.rb'))
76
+ end
77
+ end
78
+
79
+ describe 'when helpers exist' do
80
+ before do
81
+ rails_rspec_autotest.find_order = %w(spec/controllers/users_controller_spec.rb spec/helpers/application_helper_spec.rb spec/helpers/users_helper_spec.rb
82
+ spec/models/user_spec.rb spec/support/blueprints.rb spec/views/users/index_spec.rb)
83
+ end
84
+
85
+ it 'finds all helper specs for default helper' do
86
+ expect(rails_rspec_autotest.test_files_for('app/helpers/application_helper.rb')).to eq(
87
+ %w(spec/helpers/application_helper_spec.rb spec/helpers/users_helper_spec.rb spec/views/users/index_spec.rb)
88
+ )
89
+ end
90
+
91
+ it 'finds helper spec' do
92
+ expect(rails_rspec_autotest.test_files_for('app/helpers/users_helper.rb')).to(
93
+ include('spec/helpers/users_helper_spec.rb')
94
+ )
95
+ end
96
+
97
+ it 'finds view spec' do
98
+ expect(rails_rspec_autotest.test_files_for('app/helpers/users_helper.rb')).to(
99
+ include('spec/views/users/index_spec.rb')
100
+ )
101
+ end
102
+ end
103
+
104
+ describe 'when models exist' do
105
+ it 'finds associated model specs' do
106
+ expect(rails_rspec_autotest.test_files_for('app/models/user.rb')).to(
107
+ include('spec/models/user_spec.rb'))
108
+ end
109
+ end
110
+
111
+ describe 'when routes change' do
112
+ before do
113
+ rails_rspec_autotest.find_order = %w(spec/controllers/users_controller_spec.rb spec/helpers/application_helper_spec.rb
114
+ spec/helpers/users_helper_spec.rb spec/models/user_spec.rb spec/routing/users_spec.rb
115
+ spec/views/users/index_spec.rb spec/views/users/index.html.erb_spec.rb)
116
+ end
117
+
118
+ it 'runs controller specs' do
119
+ expect(rails_rspec_autotest.test_files_for('config/routes.rb')).to(
120
+ include('spec/controllers/users_controller_spec.rb'))
121
+ end
122
+
123
+ it 'runs helper specs' do
124
+ expect(rails_rspec_autotest.test_files_for('config/routes.rb')).to(
125
+ include('spec/helpers/users_helper_spec.rb'))
126
+ end
127
+
128
+ it 'does not run model specs' do
129
+ expect(rails_rspec_autotest.test_files_for('config/routes.rb')).not_to(
130
+ include('spec/models/user_spec.rb'))
131
+ end
132
+
133
+ it 'runs routing specs' do
134
+ expect(rails_rspec_autotest.test_files_for('config/routes.rb')).to(
135
+ include('spec/routing/users_spec.rb'))
136
+ end
137
+
138
+ it 'runs views specs' do
139
+ expect(rails_rspec_autotest.test_files_for('config/routes.rb')).to(
140
+ include('spec/views/users/index_spec.rb'))
141
+ end
142
+ end
143
+
144
+ it 'runs lib specs on change' do
145
+ rails_rspec_autotest.find_order = %w(spec/lib/make_money_spec.rb spec/models/user_spec.rb)
146
+ expect(rails_rspec_autotest.test_files_for('lib/make_money.rb')).to(
147
+ include('spec/lib/make_money_spec.rb'))
148
+ end
149
+
150
+ it 'runs mailer specs on change' do
151
+ rails_rspec_autotest.find_order = %w(spec/mailers/compliment_user_spec.rb spec/models/user_spec.rb)
152
+ expect(rails_rspec_autotest.test_files_for('app/mailers/compliment_user.rb')).to(
153
+ include('spec/mailers/compliment_user_spec.rb'))
154
+ end
155
+
156
+ it 'runs model specs when database config changes' do
157
+ rails_rspec_autotest.find_order = %w(spec/controllers/application_controller_spec.rb spec/models/admin_spec.rb spec/models/user_spec.rb)
158
+ expect(rails_rspec_autotest.test_files_for('config/database.yml')).to eq(
159
+ %w(spec/models/admin_spec.rb spec/models/user_spec.rb))
160
+ end
161
+
162
+ it 'runs view specs when views change' do
163
+ rails_rspec_autotest.find_order = %w(spec/views/users_spec.rb spec/views/users/index.html.erb_spec.rb)
164
+ expect(rails_rspec_autotest.test_files_for('app/views/users/index.html.erb')).to(
165
+ include('spec/views/users/index.html.erb_spec.rb'))
166
+ end
33
167
  end
34
168
 
35
169
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-autotest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.0.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Steven Baker
@@ -11,92 +10,82 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2014-06-01 00:00:00.000000000 Z
13
+ date: 2018-09-05 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: rspec-core
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
- - - ! '>='
19
+ - - ">="
22
20
  - !ruby/object:Gem::Version
23
21
  version: 2.99.0.beta1
24
- - - <
22
+ - - "<"
25
23
  - !ruby/object:Gem::Version
26
24
  version: 4.0.0
27
25
  type: :runtime
28
26
  prerelease: false
29
27
  version_requirements: !ruby/object:Gem::Requirement
30
- none: false
31
28
  requirements:
32
- - - ! '>='
29
+ - - ">="
33
30
  - !ruby/object:Gem::Version
34
31
  version: 2.99.0.beta1
35
- - - <
32
+ - - "<"
36
33
  - !ruby/object:Gem::Version
37
34
  version: 4.0.0
38
35
  - !ruby/object:Gem::Dependency
39
36
  name: bundler
40
37
  requirement: !ruby/object:Gem::Requirement
41
- none: false
42
38
  requirements:
43
- - - ! '>='
39
+ - - ">="
44
40
  - !ruby/object:Gem::Version
45
41
  version: '1.3'
46
42
  type: :development
47
43
  prerelease: false
48
44
  version_requirements: !ruby/object:Gem::Requirement
49
- none: false
50
45
  requirements:
51
- - - ! '>='
46
+ - - ">="
52
47
  - !ruby/object:Gem::Version
53
48
  version: '1.3'
54
49
  - !ruby/object:Gem::Dependency
55
50
  name: rake
56
51
  requirement: !ruby/object:Gem::Requirement
57
- none: false
58
52
  requirements:
59
- - - ! '>='
53
+ - - ">="
60
54
  - !ruby/object:Gem::Version
61
55
  version: 10.0.0
62
56
  type: :development
63
57
  prerelease: false
64
58
  version_requirements: !ruby/object:Gem::Requirement
65
- none: false
66
59
  requirements:
67
- - - ! '>='
60
+ - - ">="
68
61
  - !ruby/object:Gem::Version
69
62
  version: 10.0.0
70
63
  - !ruby/object:Gem::Dependency
71
64
  name: ZenTest
72
65
  requirement: !ruby/object:Gem::Requirement
73
- none: false
74
66
  requirements:
75
- - - ! '>='
67
+ - - ">="
76
68
  - !ruby/object:Gem::Version
77
69
  version: '4.6'
78
70
  type: :development
79
71
  prerelease: false
80
72
  version_requirements: !ruby/object:Gem::Requirement
81
- none: false
82
73
  requirements:
83
- - - ! '>='
74
+ - - ">="
84
75
  - !ruby/object:Gem::Version
85
76
  version: '4.6'
86
77
  - !ruby/object:Gem::Dependency
87
78
  name: activesupport
88
79
  requirement: !ruby/object:Gem::Requirement
89
- none: false
90
80
  requirements:
91
- - - ~>
81
+ - - "~>"
92
82
  - !ruby/object:Gem::Version
93
83
  version: '3.0'
94
84
  type: :development
95
85
  prerelease: false
96
86
  version_requirements: !ruby/object:Gem::Requirement
97
- none: false
98
87
  requirements:
99
- - - ~>
88
+ - - "~>"
100
89
  - !ruby/object:Gem::Version
101
90
  version: '3.0'
102
91
  description: RSpec Autotest integration
@@ -105,9 +94,9 @@ executables: []
105
94
  extensions: []
106
95
  extra_rdoc_files: []
107
96
  files:
108
- - .gitignore
109
- - .rspec
110
- - .travis.yml
97
+ - ".gitignore"
98
+ - ".rspec"
99
+ - ".travis.yml"
111
100
  - Changelog.md
112
101
  - Gemfile
113
102
  - License.txt
@@ -130,29 +119,28 @@ files:
130
119
  homepage: https://github.com/rspec/rspec-autotest
131
120
  licenses:
132
121
  - MIT
122
+ metadata: {}
133
123
  post_install_message:
134
124
  rdoc_options:
135
- - --charset=UTF-8
125
+ - "--charset=UTF-8"
136
126
  require_paths:
137
127
  - lib
138
128
  required_ruby_version: !ruby/object:Gem::Requirement
139
- none: false
140
129
  requirements:
141
- - - ! '>='
130
+ - - ">="
142
131
  - !ruby/object:Gem::Version
143
132
  version: 1.8.7
144
133
  required_rubygems_version: !ruby/object:Gem::Requirement
145
- none: false
146
134
  requirements:
147
- - - ! '>='
135
+ - - ">="
148
136
  - !ruby/object:Gem::Version
149
137
  version: '0'
150
138
  requirements: []
151
- rubyforge_project: rspec
152
- rubygems_version: 1.8.23.2
139
+ rubyforge_project:
140
+ rubygems_version: 2.7.6
153
141
  signing_key:
154
- specification_version: 3
155
- summary: rspec-autotest-1.0.0
142
+ specification_version: 4
143
+ summary: rspec-autotest-1.0.1
156
144
  test_files:
157
145
  - spec/autotest/discover_spec.rb
158
146
  - spec/autotest/failed_results_re_spec.rb
@@ -160,4 +148,3 @@ test_files:
160
148
  - spec/autotest/rspec_spec.rb
161
149
  - spec/spec_helper.rb
162
150
  - spec/support/matchers.rb
163
- has_rdoc: