Skip to content

Commit

Permalink
Merge b9cc0e4 into 9fcd994
Browse files Browse the repository at this point in the history
  • Loading branch information
bquorning committed Jul 26, 2015
2 parents 9fcd994 + b9cc0e4 commit 66c6d41
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ pkg

# For rubinius:
#*.rbc

/vendor
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ matrix:
allow_failures:
- rvm: ruby-head
- rvm: rbx-2
before_install: gem update --remote bundler
before_install:
- gem update --remote bundler
- git clone --depth 1 git://github.com/bbatsov/rubocop.git vendor/rubocop
script:
- bundle exec rake
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ RSpec/FilePath:
```


## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

For running the spec files, this project depends on RuboCop's spec helpers.
This means that in order to run the specs locally, you need a (shallow) clone
of the RuboCop repository:

```bash
git clone --depth 1 git://github.com/bbatsov/rubocop.git vendor/rubocop
```

## License

`rubocop-rspec` is MIT licensed. [See the accompanying file](MIT-LICENSE.md) for
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/described_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def on_block(node)
end

def autocorrect(node)
@corrections << lambda do |corrector|
lambda do |corrector|
corrector.replace(node.loc.expression, 'described_class')
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/rubocop/cop/rspec/example_wording.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ExampleWording < Cop
MSG = 'Do not use should when describing your tests.'

def on_block(node) # rubocop:disable Metrics/AbcSize
method, _, _ = *node
method, = *node
_, method_name, *args = *method

return unless method_name == :it
Expand All @@ -38,7 +38,7 @@ def on_block(node) # rubocop:disable Metrics/AbcSize
end

def autocorrect(range)
@corrections << lambda do |corrector|
lambda do |corrector|
corrector.replace(range, corrected_message(range))
end
end
Expand Down
4 changes: 2 additions & 2 deletions rubocop-rspec.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Gem::Specification.new do |spec|
'Gemfile',
'Rakefile'
]
spec.test_files = spec.files.grep(/^spec\//)
spec.test_files = spec.files.grep(%r{^spec/})
spec.extra_rdoc_files = ['MIT-LICENSE.md', 'README.md']

spec.add_development_dependency('rubocop', '~> 0.24')
spec.add_development_dependency('rubocop', '~> 0.31')
spec.add_development_dependency('rake', '~> 10.1')
spec.add_development_dependency('rspec', '~> 3.0')
spec.add_development_dependency('simplecov', '~> 0.8')
Expand Down
7 changes: 5 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

require 'rubocop'

rubocop_gem_path = Gem::Specification.find_by_name('rubocop').gem_dir
Dir["#{rubocop_gem_path}/spec/support/**/*.rb"].each { |f| require f }
rubocop_path = File.join(File.dirname(__FILE__), '../vendor/rubocop')
unless File.directory?(rubocop_path)
fail "Can't run specs without a local RuboCop checkout. Look in the README."
end
Dir["#{rubocop_path}/spec/support/**/*.rb"].each { |f| require f }

RSpec.configure do |config|
config.order = :random
Expand Down
Empty file added vendor/.gitkeep
Empty file.

0 comments on commit 66c6d41

Please sign in to comment.