Skip to content

Commit

Permalink
fix broken guard list cmd and its spec
Browse files Browse the repository at this point in the history
  • Loading branch information
e2 committed Nov 2, 2014
1 parent f06234d commit fa9a547
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/guard/dsl_describer.rb
Expand Up @@ -35,11 +35,13 @@ def initialize(options = {})
# @see CLI#list
#
def list
_evaluate_guardfile
names = ::Guard::PluginUtil.plugin_names.sort.uniq
final_rows = names.inject([]) do |rows, name|
used = ::Guard.plugins(name).any?
rows << {
Plugin: name.capitalize,
Guardfile: ::Guard.plugins(name) ? "✔" : "✘"
Guardfile: used ? "✔" : "✘"
}
end

Expand Down
2 changes: 2 additions & 0 deletions spec/lib/guard/dsl_describer_spec.rb
Expand Up @@ -67,13 +67,15 @@
end

before do
stub_user_guard_rb
allow(::Guard::PluginUtil).to receive(:plugin_names) do
%w(test another even more)
end
end

it "lists the available Guards declared as strings or symbols" do
::Guard::DslDescriber.new(guardfile_contents: guardfile).list
expect(@output).to eq result
end
end

Expand Down

0 comments on commit fa9a547

Please sign in to comment.