Sorry, my english is terrible.
I want to monitoring test in rspec.
i tried below, but "create!" doesn't puts stdout.
Please teach me something wrong point.
Thanks.
https://github.com/onigra/fssm_test
# test.rb
require 'fssm'
module Foo
def self.run
FSSM.monitor(File.expand_path("./lib/tmp"), "**/*") do
create { |monitoring_dir, new_file| puts "create!" }
end
end
end
# Foo.run
# test_spec.rb
require 'spec_helper'
describe Foo do
before :all do
@path = File.expand_path("./lib/tmp")
@pid = fork { Foo.run }
end
after :all do
Process.kill "KILL", @pid
File.delete "#{@path}/file"
end
describe ".run" do
it "puts create!" do
FileUtils.touch "#{@path}/file"
end
end
end
Sorry, my english is terrible.
I want to monitoring test in rspec.
i tried below, but "create!" doesn't puts stdout.
Please teach me something wrong point.
Thanks.
https://github.com/onigra/fssm_test