Skip to content

Commit

Permalink
Merge pull request #40 from esposito/patch-1
Browse files Browse the repository at this point in the history
Fix specs
  • Loading branch information
jejacks0n committed Feb 21, 2015
2 parents 4fd5c29 + fb9a8e5 commit 7febb3d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions guard-teaspoon.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {spec,test}/*`.split("\n")

s.add_dependency "guard", "~> 2.2"
s.add_dependency "guard-compat", "~> 1.2"
s.add_dependency "teaspoon", ">= 0.8.0"
end
7 changes: 2 additions & 5 deletions lib/guard/teaspoon.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require "guard"
require "guard/plugin"
require "guard/compat/plugin"

module Guard
class Teaspoon < Plugin
Expand Down Expand Up @@ -30,8 +29,6 @@ def start
end

def run_all
# run all tests instead of running only the last run tests
@options.delete :files
passed = @runner.run_all(@options[:run_all])

if passed
Expand Down Expand Up @@ -71,7 +68,7 @@ def run_on_modifications(original_paths)
private

def notify(status)
::Guard::Notifier.notify(status.to_s.capitalize, title: "Teaspoon Guard", image: status)
Guard::Compat::UI.notify(status.to_s.capitalize, title: "Teaspoon Guard", image: status)
end

def remove_failed(paths)
Expand Down
2 changes: 2 additions & 0 deletions lib/guard/teaspoon/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def initialize(options = {})
end

def run_all(options = {})
# run all tests instead of running only the last run tests
@options.delete :files
@console.execute(@options.merge(options))
end

Expand Down
7 changes: 7 additions & 0 deletions spec/guard/teaspoon/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
subject.run_all(baz: "teaspoon")
end

it 'removes previously set files so that all files are run' do
subject = Guard::Teaspoon::Runner.new(files: ["file1", "file2"], baz: "teaspoon")
subject.console = console
console.should_receive(:execute).with(foo: "bar", baz: "teaspoon")
subject.run_all(foo: "bar")
end

end

describe "#run" do
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Coveralls.wear!

require "guard/teaspoon"
require "guard/compat/test/helper"

Dir[File.expand_path("../support/**/*.rb", __FILE__)].each { |f| require f }

Expand Down

0 comments on commit 7febb3d

Please sign in to comment.