Skip to content

Commit

Permalink
Fix rubocop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Jun 1, 2015
1 parent ee4c8b4 commit ee74335
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ guard 'bundler' do
end

guard :rspec, :cli => '-fs --color --order rand' do
watch(/^spec\/.+_spec\.rb$/)
watch(/^lib\/(.+)\.rb$/) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
end

Expand Down
2 changes: 1 addition & 1 deletion lib/naught/null_class_builder/commands/traceable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def call
def initialize(options = {})
range = (RUBY_VERSION.to_f == 1.9 && RUBY_PLATFORM != 'java') ? 4 : 3
backtrace = options.fetch(:caller) { Kernel.caller(range) }
@__file__, line, _ = backtrace[0].split(':')
@__file__, line, = backtrace[0].split(':')
@__line__ = line.to_i
end
end
Expand Down
4 changes: 2 additions & 2 deletions naught.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Gem::Specification.new do |spec|
spec.license = 'MIT'

spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.add_development_dependency 'bundler', '~> 1.3'
Expand Down
3 changes: 2 additions & 1 deletion spec/functions/maybe_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
end

it 'generates null objects with useful trace info' do
null, line = Maybe(), __LINE__
null = Maybe()
line = __LINE__
expect(null.__file__).to eq(__FILE__)
expect(null.__line__).to eq(line)
end
Expand Down
3 changes: 2 additions & 1 deletion spec/functions/null_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
end

it 'generates null objects with useful trace info' do
null, line = Null(), __LINE__
null = Null()
line = __LINE__
expect(null.__file__).to eq(__FILE__)
expect(null.__line__).to eq(line)
end
Expand Down
6 changes: 4 additions & 2 deletions spec/naught_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class Point
null_object_and_line.first
end
let(:null_object_and_line) do
obj, line = trace_null_class.new, __LINE__
obj = trace_null_class.new
line = __LINE__
[obj, line]
end
let(:instantiation_line) { null_object_and_line.last }
Expand All @@ -52,7 +53,8 @@ def make_null
end

it 'can accept custom backtrace info' do
obj, line = make_null, __LINE__
obj = make_null
line = __LINE__
expect(obj.__line__).to eq(line)
end
end
Expand Down

0 comments on commit ee74335

Please sign in to comment.