rspec-autotest 1.0.0.beta1 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NzRkNjFhODIxN2ZjM2Q1ZTUzNjI3NTY5OTRlNDNkOTE4MGM1MmM2OQ==
5
- data.tar.gz: !binary |-
6
- ZGVmZTAyZmEyMzYwNTlhMDZiM2U5MjMxMTgyZjBkMjQ5ODk5NTU0Nw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MzMwNmIzNDVjN2I4NWNjNWYwODgwMGNmYzQ0YjY0ZDZlMmZkZGU0MzNkN2E5
10
- YWI1NjRiMWVlZjBjYzY4NWNkYTkyMTNmM2JjY2E5MTUzOGE5NDk3ODJhMDMz
11
- YzUzY2VmNTRiZGRjYTgwYTRiMTM0OThkMzhlYjc1NTM3OWExZWY=
12
- data.tar.gz: !binary |-
13
- NGY1M2I1ODUyNmJiNWY4MWUxZDgxNDk3ODEzMzU0NWM0NmNjYjYwODFkNjNl
14
- YTI2MDBhMzI5NjZhMzRmNDM0Mjc5NjY5OWJjM2U2YjMzZTBlN2FkNDc5Mzli
15
- MGY3NTQzNzBmNWE1YjkyZWQ4ZWJhYzllNmZhNDlkYTgwNGJjMWY=
2
+ SHA1:
3
+ metadata.gz: b9182ec51c2aec875f4950717a1dce83f9e28ad8
4
+ data.tar.gz: 2af05b5a7bac2709394b71af7d13349f0d9ca7fe
5
+ SHA512:
6
+ metadata.gz: 755d933cf426cf0044ec09073d1467079f14fdc3fa3affd5785d9d5aee15c1e96eb3fb0354111c2e89d215339e963451b315c4b1f3b8fef0f34be7497952c266
7
+ data.tar.gz: f4b3c85a888f7c6ffed7c21769d50afec3ca86047a88c15c9a4edd442a4c82ece57c0decf8c3d87be3152a891e9c43171bce0bc52bfa3296948802a382ad14a2
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --default_path spec
2
1
  --order rand
3
2
  --warnings
3
+ --color
data/.travis.yml CHANGED
@@ -5,9 +5,19 @@ rvm:
5
5
  - 1.8.7
6
6
  - 1.9.2
7
7
  - 1.9.3
8
+ - 2.0.0
9
+ - 2.1.0
10
+ - 2.1.1
11
+ - 2.1.2
8
12
  - ree
9
13
  - jruby-18mode
10
- - jruby-19mode
11
- - rbx-18mode
12
- - rbx-19mode
13
- - 2.0.0
14
+ - jruby
15
+ - rbx
16
+ env:
17
+ - RSPEC_BRANCH=master
18
+ - RSPEC_BRANCH=2-99-maintenance
19
+ matrix:
20
+ allow_failures:
21
+ - rvm: rbx
22
+ fast_finish: true
23
+
data/Gemfile CHANGED
@@ -2,12 +2,15 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- %w[rspec rspec-core rspec-expectations rspec-mocks].each do |lib|
5
+ %w[rspec rspec-core rspec-expectations rspec-mocks rspec-support].each do |lib|
6
+ branch = ENV.fetch('RSPEC_BRANCH', 'master')
7
+ next if branch == '2-99-maintenance' && lib == 'rspec-support'
8
+
6
9
  library_path = File.expand_path("../../#{lib}", __FILE__)
7
- if File.exist?(library_path)
10
+ if File.exist?(library_path) && !ENV['USE_GIT_REPOS']
8
11
  gem lib, :path => library_path
9
12
  else
10
- gem lib, :git => "git://github.com/rspec/#{lib}.git", :branch => '2-99-maintenance'
13
+ gem lib, :git => "git://github.com/rspec/#{lib}.git", :branch => branch
11
14
  end
12
15
  end
13
16
 
@@ -18,7 +21,4 @@ platforms :ruby do
18
21
  gem 'github-markup', '0.7.2'
19
22
  end
20
23
 
21
- ### dep for ci/coverage
22
- gem 'coveralls', :require => false
23
-
24
24
  eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom')
@@ -1 +1 @@
1
- Autotest.add_discovery { "rspec2" } if File.exist?("./.rspec")
1
+ Autotest.add_discovery { "rspec" }
File without changes
File without changes
@@ -4,8 +4,7 @@ require 'autotest'
4
4
  # Derived from the `Autotest` class, extends the `autotest` command to work
5
5
  # with RSpec.
6
6
  #
7
- class Autotest::Rspec2 < Autotest
8
-
7
+ class Autotest::Rspec < Autotest
9
8
  def initialize
10
9
  super()
11
10
  clear_mappings
@@ -13,7 +12,7 @@ class Autotest::Rspec2 < Autotest
13
12
 
14
13
  # Example for Ruby 1.8: http://rubular.com/r/AOXNVDrZpx
15
14
  # Example for Ruby 1.9: http://rubular.com/r/85ag5AZ2jP
16
- self.failed_results_re = /^\s*\d+\).*\n\s+(?:\e\[\d*m)?Failure.*(\n(?:\e\[\d*m)?\s+#\s(.*)?:\d+(?::.*)?(?:\e\[\d*m)?)+$/m
15
+ self.failed_results_re = /^\s*\d+\).*\n\s+(?:\e\[\d*m)?Failure.*(\n(?:(?:\e\[\d*m)|(?:\s))+#\s(.*)?:\d+(?::.*)?(?:\e\[\d*m)?)+$/m
17
16
  self.completed_re = /\n(?:\e\[\d*m)?\d* examples?/m
18
17
  end
19
18
 
@@ -44,7 +43,7 @@ class Autotest::Rspec2 < Autotest
44
43
  # Overrides Autotest's implementation to generate the rspec command to run
45
44
  def make_test_cmd(files_to_test)
46
45
  files_to_test.empty? ? '' :
47
- %|#{prefix}"#{ruby}"#{suffix} -S "#{RSpec::Core.path_to_executable}" --tty #{normalize(files_to_test).keys.flatten.map { |f| %|"#{f}"|}.join(' ')}|
46
+ %|#{prefix}"#{ruby}"#{suffix} -S "#{::RSpec::Core.path_to_executable}" --tty #{normalize(files_to_test).keys.flatten.map { |f| %|"#{f}"|}.join(' ')}|
48
47
  end
49
48
 
50
49
  # Generates a map of filenames to Arrays for Autotest
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Autotest
3
- VERSION = "1.0.0.beta1"
3
+ VERSION = "1.0.0.rc1"
4
4
  end
5
5
  end
@@ -23,16 +23,16 @@
23
23
  $:.push(*Dir["vendor/rails/*/lib"])
24
24
 
25
25
  require 'active_support/core_ext'
26
- require 'autotest/rspec2'
26
+ require 'autotest/rspec'
27
27
 
28
- class Autotest::RailsRspec2 < Autotest::Rspec2
28
+ class Autotest::RailsRspec < Autotest::Rspec
29
29
 
30
30
  def initialize
31
31
  super
32
- setup_rails_rspec2_mappings
32
+ setup_rails_rspec_mappings
33
33
  end
34
34
 
35
- def setup_rails_rspec2_mappings
35
+ def setup_rails_rspec_mappings
36
36
  %w{coverage/ db/ doc/ log/ public/ script/ tmp/ vendor/rails vendor/plugins vendor/gems}.each do |exception|
37
37
  add_exception(/^([\.\/]*)?#{exception}/)
38
38
  end
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.required_ruby_version = '>= 1.8.7'
24
24
 
25
- spec.add_dependency "rspec-core", ">= 2.99.0.pre"
25
+ spec.add_dependency "rspec-core", ">= 2.99.0.beta1", "< 4.0.0"
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 1.3"
28
28
  spec.add_development_dependency "rake", "~> 10.0.0"
@@ -1,19 +1,8 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "autotest/discover.rb" do
4
- context "with ./.rspec present" do
5
- it "adds 'rspec2' to the list of discoveries" do
6
- File.stub(:exist?).with("./.rspec") { true }
7
- Autotest.should_receive(:add_discovery)
8
- load File.expand_path("../../../lib/autotest/discover.rb", __FILE__)
9
- end
10
- end
11
-
12
- context "with ./.rspec absent" do
13
- it "does not add 'rspec2' to the list of discoveries" do
14
- File.stub(:exist?) { false }
15
- Autotest.should_not_receive(:add_discovery)
16
- load File.expand_path("../../../lib/autotest/discover.rb", __FILE__)
17
- end
4
+ it "adds 'rspec' to the list of discoveries" do
5
+ expect(Autotest).to receive(:add_discovery)
6
+ load File.expand_path("../../../lib/autotest/discover.rb", __FILE__)
18
7
  end
19
8
  end
@@ -5,39 +5,52 @@ describe "failed_results_re for autotest" do
5
5
  group = RSpec::Core::ExampleGroup.describe("group")
6
6
  group.example("example") { yield }
7
7
  io = StringIO.new
8
- formatter = RSpec::Core::Formatters::BaseTextFormatter.new(io)
9
- reporter = RSpec::Core::Reporter.new(formatter)
10
-
11
- group.run(reporter)
12
- reporter.report(1, nil) {}
8
+ run_group(group, io)
13
9
  io.string
14
10
  end
15
11
 
12
+ if RSpec::Core::Version::STRING.to_f >= 3
13
+ def run_group(group, io)
14
+ options = RSpec::Core::ConfigurationOptions.new([])
15
+ config = RSpec::Core::Configuration.new
16
+ runner = RSpec::Core::Runner.new(options, config)
17
+ runner.setup(io, io)
18
+ runner.run_specs([group])
19
+ end
20
+ else
21
+ def run_group(group, io)
22
+ formatter = RSpec::Core::Formatters::BaseTextFormatter.new(io)
23
+ reporter = RSpec::Core::Reporter.new(formatter)
24
+ group.run(reporter)
25
+ reporter.report(1, nil) { }
26
+ end
27
+ end
28
+
16
29
  shared_examples "autotest failed_results_re" do
17
30
  it "matches a failure" do
18
31
  output = run_example { fail }
19
- expect(output).to match(Autotest::Rspec2.new.failed_results_re)
32
+ expect(output).to match(Autotest::Rspec.new.failed_results_re)
20
33
  expect(output).to include(__FILE__.sub(File.expand_path('.'),'.'))
21
34
  end
22
35
 
23
36
  it "does not match when there are no failures" do
24
37
  output = run_example { } # pass
25
- expect(output).not_to match(Autotest::Rspec2.new.failed_results_re)
38
+ expect(output).not_to match(Autotest::Rspec.new.failed_results_re)
26
39
  expect(output).not_to include(__FILE__.sub(File.expand_path('.'),'.'))
27
40
  end
28
41
  end
29
42
 
30
43
  context "with color enabled" do
31
44
  before do
32
- RSpec.configuration.stub(:color_enabled? => true)
45
+ allow(RSpec.configuration).to receive(:color_enabled?).and_return(true)
33
46
  end
34
47
 
35
48
  include_examples "autotest failed_results_re"
36
49
  end
37
50
 
38
- context "with color disabled " do
51
+ context "with color disabled" do
39
52
  before do
40
- RSpec.configuration.stub(:color_enabled? => false)
53
+ allow(RSpec.configuration).to receive(:color_enabled?).and_return(false)
41
54
  end
42
55
 
43
56
  include_examples "autotest failed_results_re"
@@ -1,12 +1,12 @@
1
1
  require "spec_helper"
2
- require "autotest/rails_rspec2"
2
+ require "autotest/rails_rspec"
3
3
 
4
- describe Autotest::RailsRspec2 do
4
+ describe Autotest::RailsRspec do
5
5
 
6
- let(:rails_rspec2_autotest) { Autotest::RailsRspec2.new }
6
+ let(:rails_rspec_autotest) { Autotest::RailsRspec.new }
7
7
 
8
8
  describe 'exceptions' do
9
- let(:exceptions_regexp) { rails_rspec2_autotest.exceptions }
9
+ let(:exceptions_regexp) { rails_rspec_autotest.exceptions }
10
10
 
11
11
  it "matches './log/test.log'" do
12
12
  expect(exceptions_regexp).to match('./log/test.log')
@@ -27,8 +27,8 @@ describe Autotest::RailsRspec2 do
27
27
 
28
28
  describe 'mappings' do
29
29
  it 'runs model specs when support files change' do
30
- rails_rspec2_autotest.find_order = %w(spec/models/user_spec.rb spec/support/blueprints.rb)
31
- expect(rails_rspec2_autotest.test_files_for('spec/support/blueprints.rb')).to(
30
+ rails_rspec_autotest.find_order = %w(spec/models/user_spec.rb spec/support/blueprints.rb)
31
+ expect(rails_rspec_autotest.test_files_for('spec/support/blueprints.rb')).to(
32
32
  include('spec/models/user_spec.rb'))
33
33
  end
34
34
  end
@@ -1,13 +1,13 @@
1
1
  require "spec_helper"
2
- require "autotest/rspec2"
2
+ require "autotest/rspec"
3
3
 
4
- describe Autotest::Rspec2 do
5
- let(:rspec_autotest) { Autotest::Rspec2.new }
4
+ describe Autotest::Rspec do
5
+ let(:rspec_autotest) { Autotest::Rspec.new }
6
6
  let(:spec_cmd) { RSpec::Core.path_to_executable }
7
7
  let(:ruby_cmd) { "/path/to/ruby" }
8
8
 
9
9
  before do
10
- File.stub(:exist?) { false }
10
+ allow(File).to receive(:exist?) { false }
11
11
  end
12
12
 
13
13
  it "uses autotest's prefix" do
@@ -17,7 +17,7 @@ describe Autotest::Rspec2 do
17
17
 
18
18
  describe "commands" do
19
19
  before do
20
- rspec_autotest.stub(:ruby => ruby_cmd)
20
+ allow(rspec_autotest).to receive(:ruby).and_return(ruby_cmd)
21
21
  files = %w[file_one file_two]
22
22
  @files_to_test = {
23
23
  files[0] => [],
@@ -128,7 +128,7 @@ describe Autotest::Rspec2 do
128
128
  ['filename.rb', './filename.rb', File.expand_path('filename.rb')].each do |file|
129
129
  @files_to_test[file] = []
130
130
  end
131
- expect(rspec_autotest.normalize(@files_to_test)).to have(1).file
131
+ expect(rspec_autotest.normalize(@files_to_test).size).to eq(1)
132
132
  end
133
133
  end
134
134
  end
data/spec/spec_helper.rb CHANGED
@@ -1,18 +1,7 @@
1
1
  require 'rubygems'
2
- require 'rspec/autorun'
3
2
  require 'rspec/autotest'
4
3
  require 'aruba/api'
5
4
 
6
- unless ENV['NO_COVERALLS']
7
- require 'simplecov' if RUBY_VERSION.to_f > 1.8
8
- require 'coveralls'
9
- Coveralls.wear! do
10
- add_filter '/bundle/'
11
- add_filter '/spec/'
12
- add_filter '/tmp/'
13
- end
14
- end
15
-
16
5
  if RUBY_PLATFORM == 'java'
17
6
  # Works around https://jira.codehaus.org/browse/JRUBY-5678
18
7
  require 'fileutils'
@@ -23,13 +12,12 @@ end
23
12
  Dir['./spec/support/**/*.rb'].map {|f| require f}
24
13
 
25
14
  RSpec.configure do |c|
26
-
27
15
  c.expect_with :rspec do |expectations|
28
16
  expectations.syntax = :expect
29
17
  end
30
18
 
31
19
  # runtime options
32
- c.treat_symbols_as_metadata_keys_with_true_values = true
20
+ c.treat_symbols_as_metadata_keys_with_true_values = true if RSpec::Core::Version::STRING.to_f < 3
33
21
  c.filter_run :focus
34
22
  c.run_all_when_everything_filtered = true
35
23
  end
@@ -9,8 +9,14 @@ RSpec::Matchers.define :map_specs do |specs|
9
9
  @file = file
10
10
  end
11
11
 
12
- failure_message_for_should do
13
- "expected #{@autotest.class} to map #{@specs.inspect} to #{@file.inspect}\ngot #{@actual.inspect}"
12
+ if respond_to?(:failure_message)
13
+ failure_message do
14
+ "expected #{@autotest.class} to map #{@specs.inspect} to #{@file.inspect}\ngot #{@actual.inspect}"
15
+ end
16
+ else
17
+ failure_message_for_should do
18
+ "expected #{@autotest.class} to map #{@specs.inspect} to #{@file.inspect}\ngot #{@actual.inspect}"
19
+ end
14
20
  end
15
21
 
16
22
  def prepare(autotest)
metadata CHANGED
@@ -1,7 +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.beta1
4
+ version: 1.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Baker
@@ -10,104 +10,110 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-11-05 00:00:00.000000000 Z
13
+ date: 2014-05-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec-core
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ! '>='
19
+ - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: 2.99.0.pre
21
+ version: 2.99.0.beta1
22
+ - - "<"
23
+ - !ruby/object:Gem::Version
24
+ version: 4.0.0
22
25
  type: :runtime
23
26
  prerelease: false
24
27
  version_requirements: !ruby/object:Gem::Requirement
25
28
  requirements:
26
- - - ! '>='
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 2.99.0.beta1
32
+ - - "<"
27
33
  - !ruby/object:Gem::Version
28
- version: 2.99.0.pre
34
+ version: 4.0.0
29
35
  - !ruby/object:Gem::Dependency
30
36
  name: bundler
31
37
  requirement: !ruby/object:Gem::Requirement
32
38
  requirements:
33
- - - ~>
39
+ - - "~>"
34
40
  - !ruby/object:Gem::Version
35
41
  version: '1.3'
36
42
  type: :development
37
43
  prerelease: false
38
44
  version_requirements: !ruby/object:Gem::Requirement
39
45
  requirements:
40
- - - ~>
46
+ - - "~>"
41
47
  - !ruby/object:Gem::Version
42
48
  version: '1.3'
43
49
  - !ruby/object:Gem::Dependency
44
50
  name: rake
45
51
  requirement: !ruby/object:Gem::Requirement
46
52
  requirements:
47
- - - ~>
53
+ - - "~>"
48
54
  - !ruby/object:Gem::Version
49
55
  version: 10.0.0
50
56
  type: :development
51
57
  prerelease: false
52
58
  version_requirements: !ruby/object:Gem::Requirement
53
59
  requirements:
54
- - - ~>
60
+ - - "~>"
55
61
  - !ruby/object:Gem::Version
56
62
  version: 10.0.0
57
63
  - !ruby/object:Gem::Dependency
58
64
  name: aruba
59
65
  requirement: !ruby/object:Gem::Requirement
60
66
  requirements:
61
- - - ~>
67
+ - - "~>"
62
68
  - !ruby/object:Gem::Version
63
69
  version: '0.5'
64
70
  type: :development
65
71
  prerelease: false
66
72
  version_requirements: !ruby/object:Gem::Requirement
67
73
  requirements:
68
- - - ~>
74
+ - - "~>"
69
75
  - !ruby/object:Gem::Version
70
76
  version: '0.5'
71
77
  - !ruby/object:Gem::Dependency
72
78
  name: ZenTest
73
79
  requirement: !ruby/object:Gem::Requirement
74
80
  requirements:
75
- - - ~>
81
+ - - "~>"
76
82
  - !ruby/object:Gem::Version
77
83
  version: '4.6'
78
84
  type: :development
79
85
  prerelease: false
80
86
  version_requirements: !ruby/object:Gem::Requirement
81
87
  requirements:
82
- - - ~>
88
+ - - "~>"
83
89
  - !ruby/object:Gem::Version
84
90
  version: '4.6'
85
91
  - !ruby/object:Gem::Dependency
86
92
  name: i18n
87
93
  requirement: !ruby/object:Gem::Requirement
88
94
  requirements:
89
- - - ~>
95
+ - - "~>"
90
96
  - !ruby/object:Gem::Version
91
97
  version: 0.6.4
92
98
  type: :development
93
99
  prerelease: false
94
100
  version_requirements: !ruby/object:Gem::Requirement
95
101
  requirements:
96
- - - ~>
102
+ - - "~>"
97
103
  - !ruby/object:Gem::Version
98
104
  version: 0.6.4
99
105
  - !ruby/object:Gem::Dependency
100
106
  name: activesupport
101
107
  requirement: !ruby/object:Gem::Requirement
102
108
  requirements:
103
- - - ~>
109
+ - - "~>"
104
110
  - !ruby/object:Gem::Version
105
111
  version: '3.0'
106
112
  type: :development
107
113
  prerelease: false
108
114
  version_requirements: !ruby/object:Gem::Requirement
109
115
  requirements:
110
- - - ~>
116
+ - - "~>"
111
117
  - !ruby/object:Gem::Version
112
118
  version: '3.0'
113
119
  description: RSpec Autotest integration
@@ -116,17 +122,17 @@ executables: []
116
122
  extensions: []
117
123
  extra_rdoc_files: []
118
124
  files:
119
- - .gitignore
120
- - .rspec
121
- - .travis.yml
125
+ - ".gitignore"
126
+ - ".rspec"
127
+ - ".travis.yml"
122
128
  - Changelog.md
123
129
  - Gemfile
124
130
  - License.txt
125
131
  - README.md
126
132
  - Rakefile
127
133
  - lib/autotest/discover.rb
128
- - lib/autotest/rails_rspec2.rb
129
- - lib/autotest/rspec2.rb
134
+ - lib/autotest/rails_rspec.rb
135
+ - lib/autotest/rspec.rb
130
136
  - lib/rspec/autotest.rb
131
137
  - lib/rspec/autotest/version.rb
132
138
  - lib/rspec/rails/autotest.rb
@@ -144,25 +150,25 @@ licenses:
144
150
  metadata: {}
145
151
  post_install_message:
146
152
  rdoc_options:
147
- - --charset=UTF-8
153
+ - "--charset=UTF-8"
148
154
  require_paths:
149
155
  - lib
150
156
  required_ruby_version: !ruby/object:Gem::Requirement
151
157
  requirements:
152
- - - ! '>='
158
+ - - ">="
153
159
  - !ruby/object:Gem::Version
154
160
  version: 1.8.7
155
161
  required_rubygems_version: !ruby/object:Gem::Requirement
156
162
  requirements:
157
- - - ! '>'
163
+ - - ">"
158
164
  - !ruby/object:Gem::Version
159
165
  version: 1.3.1
160
166
  requirements: []
161
167
  rubyforge_project: rspec
162
- rubygems_version: 2.0.7
168
+ rubygems_version: 2.2.2
163
169
  signing_key:
164
170
  specification_version: 4
165
- summary: rspec-autotest-1.0.0.beta1
171
+ summary: rspec-autotest-1.0.0.rc1
166
172
  test_files:
167
173
  - spec/autotest/discover_spec.rb
168
174
  - spec/autotest/failed_results_re_spec.rb