respec 0.4.0 → 0.4.1

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.4.1 2012-11-15
2
+
3
+ * Run spec directory by default, like rspec.
4
+
1
5
  == 0.4.0 2012-11-11
2
6
 
3
7
  * Fix further issues with custom formatter being overridden by respec.
data/lib/respec/app.rb CHANGED
@@ -113,6 +113,11 @@ module Respec
113
113
  args << '--example' << arg.gsub(/[$]/, '\\\\\\0')
114
114
  end
115
115
  end
116
+
117
+ # Since we append our formatter as a file to run, rspec won't fall back to
118
+ # using 'spec' by default. Add it explicitly here.
119
+ files << 'spec' if files.empty?
120
+
116
121
  # If we selected individual failures to rerun, don't give the files to
117
122
  # rspec, as those files will be run in their entirety.
118
123
  @generated_args = args
@@ -1,5 +1,5 @@
1
1
  module Respec
2
- VERSION = [0, 4, 0]
2
+ VERSION = [0, 4, 1]
3
3
 
4
4
  class << VERSION
5
5
  include Comparable
@@ -70,13 +70,15 @@ describe Respec::App do
70
70
  end
71
71
 
72
72
  describe "#generated_args" do
73
- it "should treat all arguments that start with '-' to rspec" do
74
- app = Respec::App.new('-a', '-b', '-c')
75
- app.generated_args.should == ['-a', '-b', '-c']
73
+ it "should pass all arguments that start with '-' to rspec" do
74
+ FileUtils.touch "#{tmp}/file"
75
+ app = Respec::App.new('-a', '-b', '-c', "#{tmp}/file")
76
+ app.generated_args.should == ['-a', '-b', '-c', "#{tmp}/file"]
76
77
  end
77
78
 
78
79
  it "should pass arguments for rspec options that need them" do
79
- Respec::App.new('-I', 'lib', '-t', 'mytag').generated_args.should == ['-I', 'lib', '-t', 'mytag']
80
+ FileUtils.touch "#{tmp}/file"
81
+ Respec::App.new('-I', 'lib', '-t', 'mytag', "#{tmp}/file").generated_args.should == ['-I', 'lib', '-t', 'mytag', "#{tmp}/file"]
80
82
  end
81
83
 
82
84
  it "should run all failures if 'f' is given" do
@@ -122,6 +124,29 @@ describe Respec::App do
122
124
  app = Respec::App.new("#{tmp}/FILE", 'f')
123
125
  app.generated_args.should == ['a.rb:1']
124
126
  end
127
+
128
+ it "should explicitly add the spec directory if no files are given or errors to rerun" do
129
+ app = Respec::App.new
130
+ app.generated_args.should == ['spec']
131
+ end
132
+
133
+ it "should not add the spec directory if any files are given" do
134
+ FileUtils.touch "#{tmp}/FILE"
135
+ app = Respec::App.new("#{tmp}/FILE")
136
+ app.generated_args.should == ["#{tmp}/FILE"]
137
+ end
138
+
139
+ it "should not add the spec directory if a numeric argument is given" do
140
+ make_failures_file 'a.rb:1'
141
+ app = Respec::App.new('1')
142
+ app.generated_args.should == ["a.rb:1"]
143
+ end
144
+
145
+ it "should not add the spec directory if an 'f' argument is given" do
146
+ make_failures_file 'a.rb:1'
147
+ app = Respec::App.new('f')
148
+ app.generated_args.should == ["a.rb:1"]
149
+ end
125
150
  end
126
151
 
127
152
  describe "#raw_args" do
@@ -136,7 +161,7 @@ describe Respec::App do
136
161
  Dir.chdir tmp do
137
162
  FileUtils.touch 'Gemfile'
138
163
  app = Respec::App.new('--', '-t', 'TAG')
139
- app.command.should == ['bundle', 'exec', 'rspec', '-t', 'TAG', FORMATTER_PATH]
164
+ app.command.should == ['bundle', 'exec', 'rspec', 'spec', '-t', 'TAG', FORMATTER_PATH]
140
165
  end
141
166
  end
142
167
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: respec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-11 00:00:00.000000000 Z
12
+ date: 2012-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -98,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  segments:
100
100
  - 0
101
- hash: 2310279171202373770
101
+ hash: -2382265690551011023
102
102
  required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  none: false
104
104
  requirements:
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  segments:
109
109
  - 0
110
- hash: 2310279171202373770
110
+ hash: -2382265690551011023
111
111
  requirements: []
112
112
  rubyforge_project:
113
113
  rubygems_version: 1.8.24