Skip to content

Commit

Permalink
Correct Style with Standardrb
Browse files Browse the repository at this point in the history
  • Loading branch information
JodyVanden committed Jul 5, 2020
1 parent 6e2e676 commit 97f1799
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source "https://rubygems.org"

# Specify your gem's dependencies in guard-standardrb.gemspec
gemspec
gemspec
12 changes: 5 additions & 7 deletions lib/guard/standardrb.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# coding: utf-8

require 'guard'
require 'guard/plugin'
require 'guard/standardrb/version'
require "guard"
require "guard/plugin"
require "guard/standardrb/version"

module Guard
class Standardrb < Plugin
Expand All @@ -11,11 +9,11 @@ def initialize
end

def start
Guard::Compat::UI.info 'Inspecting Ruby code style of all files with standardrb'
Guard::Compat::UI.info "Inspecting Ruby code style of all files with standardrb"
end

def run_on_modifications(res)
Guard::Compat::UI.info 'StandardRb a file was modified'
Guard::Compat::UI.info "StandardRb a file was modified"
inspect_with_standardrb(res)

$stdout.puts res if res
Expand Down
16 changes: 8 additions & 8 deletions spec/guard/standardrb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
expect(Guard::StandardrbVersion).not_to be nil
end

let(:standardrb) {Guard::Standardrb.new}
let(:standardrb) { Guard::Standardrb.new }

describe "#start" do
it "prints message" do
expect(Guard::Compat::UI).to receive(:info).
with("Inspecting Ruby code style of all files with standardrb")
expect(Guard::Compat::UI).to receive(:info)
.with("Inspecting Ruby code style of all files with standardrb")

standardrb.start
standardrb.start
end
end

describe "#run_on_modifications" do
it "prints message" do
expect(Guard::Compat::UI).to receive(:info).
with("StandardRb a file was modified")
expect(Guard::Compat::UI).to receive(:info)
.with("StandardRb a file was modified")

standardrb.run_on_modifications([])
standardrb.run_on_modifications([])
end
end

describe "#inspect_with_standardrb" do
let(:paths) {["lorem", "lorem"]}
let(:paths) { ["lorem", "lorem"] }

it "runs standardrb on the files" do
allow_any_instance_of(Kernel).to receive(:system)
Expand Down

0 comments on commit 97f1799

Please sign in to comment.