spec/command_spec.rb in dev_tasks-1.0.9 vs spec/command_spec.rb in dev_tasks-1.0.10
- old
+ new
@@ -53,9 +53,18 @@
cmd[:end_time]=Time.now
expect(cmd[:end_time]).not_to eq(nil)
end
+ it "should be able to write to/load from JSON" do
+ cmd=Command.new("ruby --version")
+ expect(cmd[:timeout]).to eq(0)
+ expect(cmd[:input]).to eq("ruby --version")
+ cmd2=Command.new(JSON.parse(cmd.to_json))
+ expect(cmd2[:timeout]).to eq(0)
+ expect(cmd2[:input]).to eq("ruby --version")
+ end
+
it "should be able to execute rake command in specific directory" do
dir="#{DEV[:dev_root]}/tmp/rake_test"
FileUtils.mkdir_p(dir) if(!File.exists?(dir))
File.open("#{dir}/rakefile.rb","w") { |f|
f.puts "task :default do"
\ No newline at end of file