Skip to content

Commit

Permalink
Merge ac9a33c into c55450c
Browse files Browse the repository at this point in the history
  • Loading branch information
e2 committed Jan 7, 2015
2 parents c55450c + ac9a33c commit 168146b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
23 changes: 23 additions & 0 deletions features/api.feature
@@ -0,0 +1,23 @@
Feature: using Guard API

In order to reuse existing Guard functionality
As a user
I want to call Guard API without Guard

Background: Guard is installed through bundler
Given my Gemfile includes "gem 'rake'"
And Guard is bundled using source

@spawn
Scenario: Call notifier
Given my Rakefile contains:
"""
require "bundler/setup"
require "guard/notifier"
task :default do
Guard::Notifier.notify "foo", title: "bar"
end
"""
Given I run `bundle exec rake`
Then the output should match /\[bar\] foo/
15 changes: 12 additions & 3 deletions features/step_definitions/guard_steps.rb
Expand Up @@ -2,10 +2,19 @@
write_file("Guardfile", contents)
end

Given(/^my Rakefile contains:$/) do |contents|
write_file("Rakefile", contents)
end

Given(/^my Gemfile includes "([^"]*)"$/) do |gem|
(@gems ||= []) << gem
end

Given(/^Guard is bundled using source$/) do
write_file(
"Gemfile",
"gem 'guard', path: File.expand_path(File.join(Dir.pwd, '..', '..'))\n")
gems = @gems || []
gems << "gem 'guard', path: File.expand_path(File.join(Dir.pwd, '..', '..'))"

write_file("Gemfile", "#{gems.join("\n")}\n")

run_simple(unescape("bundle install --quiet"), true)
end
Expand Down
1 change: 1 addition & 0 deletions lib/guard/ui.rb
Expand Up @@ -23,6 +23,7 @@ class << self
#
def logger
@logger ||= begin
require "lumberjack"
Lumberjack::Logger.new(
options.fetch(:device) { $stderr },
options)
Expand Down

0 comments on commit 168146b

Please sign in to comment.