Skip to content

Commit

Permalink
feat(Guard): add Guard to the project (ruby-formatter#12)
Browse files Browse the repository at this point in the history
* feat(Guard): Add Guard to the project

* feat(Guard): Organize spec files

Organize files in the `spec` directory to follow the convenionts of a vanilla Guard setup.

* feat(Guard): move `rufo_spec`s into `formatter_spec`

Since all of the tests in `spec/rufo_spec` are really testing the formatter, let's move those tests into `spec/lib/rufo/formatter_spec` where they belong.

* fix(rufo_spec): rm `rufo_spec`

Now that the tests are moved into `formatter_spec`, we can rm `rufo_spec`.
  • Loading branch information
bweave authored and Daniel Ma committed Aug 14, 2017
1 parent 2e56fd8 commit 0e3fd5a
Show file tree
Hide file tree
Showing 112 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
guard :rspec, cmd: 'rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
end
1 change: 1 addition & 0 deletions rufo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", "~> 1.15"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "guard-rspec", "~> 4.0"
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions spec/rufo_spec.rb → spec/lib/rufo/formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ def assert_format(code, expected = code, **options)
ex.metadata[:line_number] = line
end

RSpec.describe Rufo do
Dir[File.join(FILE_PATH, "/source_specs/*")].each do |source_specs|
RSpec.describe Rufo::Formatter do
Dir[File.join(FILE_PATH, "/formatter_source_specs/*")].each do |source_specs|
assert_source_specs(source_specs) if File.file?(source_specs)
end

if VERSION >= Gem::Version.new("2.3")
Dir[File.join(FILE_PATH, "/source_specs/2.3/*")].each do |source_specs|
Dir[File.join(FILE_PATH, "/formatter_source_specs/2.3/*")].each do |source_specs|
assert_source_specs(source_specs) if File.file?(source_specs)
end
end
Expand Down

0 comments on commit 0e3fd5a

Please sign in to comment.