Skip to content

Commit f9d7532

Browse files
committed
Change spec blocks to use double-quotes
git reset --hard HEAD; git grep "'" spec | \ cut -d: -f1 | sort -u | \ xargs perl -pi -w -e \ "s/(it|specify|context|describe) '([^']+)' do/\1 QUOTE\2QUOTE do/g;" git grep QUOTE spec | cut -d: -f1 | sort -u | \ xargs perl -pi -w -e 's/QUOTE/"/g;'
1 parent a7d9d22 commit f9d7532

23 files changed

+104
-104
lines changed

spec/cli/helper_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@
155155
expect(helper.process_options(["--roodi"])[:roodi]).to be_truthy
156156
end
157157

158-
context 'given a single format' do
158+
context "given a single format" do
159159
it "sets the format" do
160160
expect(helper.process_options(["--format", "json"])[:format]).to eq([['json']])
161161
end
162162
end
163163

164-
context 'given multiple formats' do
164+
context "given multiple formats" do
165165
it "sets multiple formats" do
166166
expect(helper.process_options(["--format", "json", "--format", "yaml"])[:format]).to eq([['json'], ['yaml']])
167167
end

spec/metric_fu/configuration_spec.rb

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
it_behaves_like 'configured' do
77

8-
describe '#is_cruise_control_rb? ' do
8+
describe "#is_cruise_control_rb? " do
99

1010
before(:each) { get_new_config }
1111
describe "when the CC_BUILD_ARTIFACTS env var is not nil" do
@@ -28,23 +28,23 @@
2828
describe "when the CC_BUILD_ARTIFACTS env var is nil" do
2929
before(:each) { ENV['CC_BUILD_ARTIFACTS'] = nil }
3030

31-
it 'should return false' do
31+
it "should return false" do
3232
expect(@config.is_cruise_control_rb?).to be_falsey
3333
end
3434
end
3535
end
3636

3737
describe "#reset" do
3838

39-
describe 'when there is a CC_BUILD_ARTIFACTS environment variable' do
39+
describe "when there is a CC_BUILD_ARTIFACTS environment variable" do
4040

4141
before do
4242
ENV['CC_BUILD_ARTIFACTS'] = 'foo'
4343
@config = MetricFu.configuration
4444
@config.reset
4545
MetricFu.configure
4646
end
47-
it 'should return the CC_BUILD_ARTIFACTS environment variable' do
47+
it "should return the CC_BUILD_ARTIFACTS environment variable" do
4848
compare_paths(base_directory, ENV['CC_BUILD_ARTIFACTS'])
4949
end
5050
after do
@@ -53,13 +53,13 @@
5353
end
5454
end
5555

56-
describe 'when there is no CC_BUILD_ARTIFACTS environment variable' do
56+
describe "when there is no CC_BUILD_ARTIFACTS environment variable" do
5757

5858
before(:each) do
5959
ENV['CC_BUILD_ARTIFACTS'] = nil
6060
get_new_config
6161
end
62-
it 'should return "tmp/metric_fu"' do
62+
it "should return 'tmp/metric_fu'" do
6363
expect(base_directory).to eq(MetricFu.artifact_dir)
6464
end
6565

@@ -88,11 +88,11 @@
8888

8989
end
9090

91-
describe '#platform' do
91+
describe "#platform" do
9292

9393
before(:each) { get_new_config }
9494

95-
it 'should return the value of the PLATFORM constant' do
95+
it "should return the value of the PLATFORM constant" do
9696
this_platform = RUBY_PLATFORM
9797
expect(@config.platform).to eq(this_platform)
9898
end

spec/metric_fu/formatter/configuration_spec.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@
44
describe MetricFu::Configuration, 'for formatters' do
55
it_behaves_like 'configured' do
66

7-
describe '#configure_formatter' do
7+
describe "#configure_formatter" do
88
before(:each) { get_new_config }
99

10-
context 'given a built-in formatter' do
10+
context "given a built-in formatter" do
1111
before do
1212
@config.configure_formatter('html')
1313
end
1414

15-
it 'adds to the list of formatters' do
15+
it "adds to the list of formatters" do
1616
expect(@config.formatters.first).to be_an_instance_of(MetricFu::Formatter::HTML)
1717
end
1818
end
1919

20-
context 'given a custom formatter by class name' do
20+
context "given a custom formatter by class name" do
2121
before do
2222
stub_const('MyCustomFormatter', Class.new() { def initialize(*); end })
2323
@config.configure_formatter('MyCustomFormatter')
2424
end
2525

26-
it 'adds to the list of formatters' do
26+
it "adds to the list of formatters" do
2727
expect(@config.formatters.first).to be_an_instance_of(MyCustomFormatter)
2828
end
2929
end
3030

31-
context 'given multiple formatters' do
31+
context "given multiple formatters" do
3232
before do
3333
stub_const('MyCustomFormatter', Class.new() { def initialize(*); end })
3434
@config.configure_formatter('html')
3535
@config.configure_formatter('yaml')
3636
@config.configure_formatter('MyCustomFormatter')
3737
end
3838

39-
it 'adds each to the list of formatters' do
39+
it "adds each to the list of formatters" do
4040
expect(@config.formatters.count).to eq(3)
4141
end
4242
end

spec/metric_fu/formatter_spec.rb

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@
22

33
describe MetricFu::Formatter do
44
describe "formatter class loading" do
5-
context 'given a built-in formatter (string)' do
5+
context "given a built-in formatter (string)" do
66
subject { MetricFu::Formatter.class_for('html') }
77

8-
it 'returns the formatter class' do
8+
it "returns the formatter class" do
99
expect(subject).to eq(MetricFu::Formatter::HTML)
1010
end
1111
end
1212

13-
context 'given a built-in formatter (symbol)' do
13+
context "given a built-in formatter (symbol)" do
1414
subject { MetricFu::Formatter.class_for(:yaml) }
1515

16-
it 'returns the formatter class' do
16+
it "returns the formatter class" do
1717
expect(subject).to eq(MetricFu::Formatter::YAML)
1818
end
1919
end
2020

21-
context 'given an unknown built-in formatter' do
21+
context "given an unknown built-in formatter" do
2222
subject { MetricFu::Formatter.class_for(:unknown) }
2323

24-
it 'raises an error' do
24+
it "raises an error" do
2525
expect{ subject }.to raise_error(NameError)
2626
end
2727
end
2828

29-
context 'given a custom formatter that exists' do
29+
context "given a custom formatter that exists" do
3030
subject { MetricFu::Formatter.class_for('MyCustomFormatter') }
3131

3232
before do
3333
stub_const('MyCustomFormatter', Class.new() { def initialize(*);end })
3434
end
3535

36-
it 'returns the formatter class' do
36+
it "returns the formatter class" do
3737
expect(subject).to eq(MyCustomFormatter)
3838
end
3939
end
4040

41-
context 'given a custom formatter that doesnt exist' do
41+
context "given a custom formatter that doesnt exist" do
4242
subject { MetricFu::Formatter.class_for('MyNonExistentCustomFormatter') }
4343

44-
it 'raises an error' do
44+
it "raises an error" do
4545
expect{ subject }.to raise_error(NameError)
4646
end
4747
end

spec/metric_fu/gem_version_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
describe MetricFu::GemVersion do
55

6-
it 'has a list of gem deps' do
6+
it "has a list of gem deps" do
77
gem_version = MetricFu::GemVersion.new
88
gem_deps = gem_version.gem_runtime_dependencies.map(&:name)
99
MetricFu::Metric.metrics.reject{|metric| metric.name == :hotspots || metric.name == :stats}.map(&:name).map(&:to_s).each do |metric_name|

spec/metric_fu/generator_spec.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,25 @@ def to_h
3636
end
3737
end
3838

39-
describe '#metric_directory' do
40-
it 'should return the results of ConcreteClass#metric_directory' do
39+
describe "#metric_directory" do
40+
it "should return the results of ConcreteClass#metric_directory" do
4141
allow(ConcreteClass).to receive(:metric_directory).and_return('foo')
4242
expect(@concrete_class.metric_directory).to eq('foo')
4343
end
4444
end
4545

4646
describe "#generate_result" do
47-
it 'should raise an error when calling #emit' do
47+
it "should raise an error when calling #emit" do
4848
@abstract_class = MetricFu::Generator.new
4949
expect { @abstract_class.generate_result }.to raise_error
5050
end
5151

52-
it 'should call #analyze' do
52+
it "should call #analyze" do
5353
@abstract_class = MetricFu::Generator.new
5454
expect { @abstract_class.generate_result }.to raise_error
5555
end
5656

57-
it 'should call #to_h' do
57+
it "should call #to_h" do
5858
@abstract_class = MetricFu::Generator.new
5959
expect { @abstract_class.generate_result }.to raise_error
6060
end

spec/metric_fu/metric_spec.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,39 @@
66
#@original_options = @metric.run_options.dup
77
end
88

9-
#it 'can have its run_options over-written' do
9+
#it "can have its run_options over-written" do
1010
#new_options = {:foo => 'bar'}
1111
#@metric.run_options = new_options
1212
#expect(@original_options).to_not eq(new_options)
1313
#expect(@metric.run_options).to eq(new_options)
1414
#end
1515

16-
#it 'can have its run_options modified' do
16+
#it "can have its run_options modified" do
1717
#new_options = {:foo => 'bar'}
1818
#@metric.run_options.merge!(new_options)
1919
#expect(@metric.run_options).to eq(@original_options.merge(new_options))
2020
#end
2121

22-
context 'given a valid configurable option' do
22+
context "given a valid configurable option" do
2323

2424
before do
2525
allow(@metric).to receive(:default_run_options).and_return({:foo => 'baz'})
2626
end
2727

28-
it 'can be configured as an attribute' do
28+
it "can be configured as an attribute" do
2929
@metric.foo = 'qux'
3030
expect(@metric.run_options[:foo]).to eq('qux')
3131
end
3232

3333
end
3434

35-
context 'given an invalid configurable option' do
35+
context "given an invalid configurable option" do
3636

3737
before do
3838
allow(@metric).to receive(:default_run_options).and_return({})
3939
end
4040

41-
it 'raises an error' do
41+
it "raises an error" do
4242
expect { @metric.foo = 'bar' }.to raise_error(RuntimeError, /not a valid configuration option/)
4343
end
4444

spec/metric_fu/metrics/churn/configuration_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
describe MetricFu::Configuration, 'for churn' do
55
it_behaves_like 'configured' do
66

7-
it 'should set @churn to {}' do
7+
it "should set @churn to {}" do
88
load_metric 'churn'
99
expect(MetricFu::Metric.get_metric(:churn).run_options).to eq(
1010
{ :start_date => %q("1 year ago"), :minimum_churn_count => 10, :ignore_files=>[], :data_directory=> MetricFu::Io::FileSystem.scratch_directory('churn')}

spec/metric_fu/metrics/flay/configuration_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
describe MetricFu::Configuration, 'for flay' do
55
it_behaves_like 'configured' do
66

7-
it 'should set @flay to {:dirs_to_flay => @code_dirs}' do
7+
it "should set @flay to {:dirs_to_flay => @code_dirs}" do
88
load_metric 'flay'
99
expect(MetricFu::Metric.get_metric(:flay).run_options).to eq(
1010
{:dirs_to_flay => ['lib'], :minimum_score=>nil}

spec/metric_fu/metrics/flog/configuration_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
it_behaves_like 'configured' do
66

77
if MetricFu.configuration.mri?
8-
it 'should set @flog to {:dirs_to_flog => @code_dirs}' do
8+
it "should set @flog to {:dirs_to_flog => @code_dirs}" do
99
load_metric 'flog'
1010
expect(MetricFu::Metric.get_metric(:flog).run_options).to eq({
1111
:all => true,

spec/metric_fu/metrics/rails_best_practices/configuration_spec.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
describe MetricFu::Configuration, 'for rails_best_practices' do
55
it_behaves_like 'configured' do
66

7-
describe 'if #rails? is true ' do
7+
describe "if #rails? is true " do
88

99
before(:each) do
1010
@config = MetricFu.configuration
@@ -16,20 +16,20 @@
1616
end
1717
end
1818

19-
describe '#set_graphs ' do
20-
it 'should set the graphs to include rails_best_practices' do
19+
describe "#set_graphs " do
20+
it "should set the graphs to include rails_best_practices" do
2121
expect(MetricFu::Metric.get_metric(:rails_best_practices).has_graph?).to be_truthy
2222
end
2323
end
2424

25-
it 'should set @rails_best_practices to {}' do
25+
it "should set @rails_best_practices to {}" do
2626
load_metric 'rails_best_practices'
2727
expect(MetricFu::Metric.get_metric(:rails_best_practices).run_options).to eql({})
2828
end
2929
end
3030

3131

32-
describe 'if #rails? is false ' do
32+
describe "if #rails? is false " do
3333
before(:each) do
3434
get_new_config
3535
allow(@config).to receive(:rails?).and_return(false)
@@ -38,7 +38,7 @@
3838
end
3939
end
4040

41-
it 'should set the registered code_dirs to ["lib"]' do
41+
it "should set the registered code_dirs to ['lib']" do
4242
expect(directory('code_dirs')).to eq(['lib'])
4343
end
4444
end

spec/metric_fu/metrics/rcov/configuration_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
describe MetricFu::Configuration, 'for rcov' do
55
it_behaves_like 'configured' do
66

7-
it 'should set rcov run_options' do
7+
it "should set rcov run_options" do
88
load_metric 'rcov'
99
expect(
1010
MetricFu::Metric.get_metric(:rcov).run_options

spec/metric_fu/metrics/rcov/simplecov_formatter_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
if defined?(JRUBY_VERSION)
3838
STDOUT.puts "Skipping spec 'cause JRuby doesn't do Coverage right"
3939
else
40-
it 'calculates the same coverage from an RCov report as from SimpleCov' do
40+
it "calculates the same coverage from an RCov report as from SimpleCov" do
4141
SimpleCov.start # start coverage
4242
require 'fixtures/coverage-153'
4343
result = SimpleCov.result # end coverage

spec/metric_fu/metrics/reek/configuration_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
describe MetricFu::Configuration, 'for reek' do
55
it_behaves_like 'configured' do
6-
it 'should set @reek to {:dirs_to_reek => @code_dirs}' do
6+
it "should set @reek to {:dirs_to_reek => @code_dirs}" do
77
load_metric 'reek'
88
expect(MetricFu::Metric.get_metric(:reek).run_options).to eq(
99
{:config_file_pattern=>nil, :dirs_to_reek => ['lib']}

0 commit comments

Comments
 (0)