Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit bbc83ce

Browse files
committed
Merge pull request #935 from rspec/fix_coveralls
Fix coveralls and a brittle test
2 parents badfb72 + 24e4d72 commit bbc83ce

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

features/support/env.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,3 @@
1212
end
1313
end if RUBY_PLATFORM == 'java'
1414

15-
require 'coveralls'
16-
Coveralls.wear! do
17-
add_filter '/bundle/'
18-
end

script/test_all

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo "--------------------------------------------------------------------"
2121
echo
2222

2323
for file in `find spec -iname '*_spec.rb'`; do
24-
bin/rspec $file -b --format progress
24+
NO_COVERALLS=1 bin/rspec $file -b --format progress
2525
done
2626

2727
# Prepare RUBYOPT for scenarios that are shelling out to ruby,

spec/rspec/core/configuration_spec.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,22 +1098,24 @@ def metadata_hash(*args)
10981098
debugger.should_receive(:start)
10991099
config.debug = true
11001100
end
1101-
1102-
it 'sets the reader to true' do
1103-
config.debug = true
1104-
expect(config.debug?).to eq true
1105-
end
11061101
end
11071102

11081103
describe "#debug=false" do
11091104
it "does not require 'ruby-debug'" do
11101105
config.should_not_receive(:require).with('ruby-debug')
11111106
config.debug = false
11121107
end
1108+
end
11131109

1114-
it 'sets the reader to false' do
1115-
config.debug = false
1116-
expect(config.debug?).to eq false
1110+
describe "#debug?" do
1111+
it 'returns true if the debugger has been loaded' do
1112+
stub_const("Debugger", Object.new)
1113+
expect(config.debug?).to be_true
1114+
end
1115+
1116+
it 'returns false if the debugger has not been loaded' do
1117+
hide_const("Debugger")
1118+
expect(config.debug?).to be_false
11171119
end
11181120
end
11191121

spec/spec_helper.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
require 'rubygems'
22

3-
require 'simplecov' if RUBY_VERSION.to_f > 1.8
4-
require 'coveralls'
5-
Coveralls.wear! do
6-
add_filter '/bundle/'
3+
unless ENV['NO_COVERALLS']
4+
require 'simplecov' if RUBY_VERSION.to_f > 1.8
5+
require 'coveralls'
6+
Coveralls.wear! do
7+
add_filter '/bundle/'
8+
add_filter '/spec/'
9+
add_filter '/tmp/'
10+
end
711
end
812

913
begin

0 commit comments

Comments
 (0)