Project

General

Profile

Download (683 Bytes) Statistics
| Branch: | Tag: | Revision:

hammer-cli-csv / test / settings_test.rb @ 5146ac68

1
require File.join(File.dirname(__FILE__), 'csv_test_helper')
2

    
3
describe 'job-templates' do
4

    
5
  extend CommandTestHelper
6

    
7
  context "import" do
8
    it "update settings w/ Count column" do
9
      set_user 'admin'
10

    
11
      name = "settings#{rand(10000)}"
12

    
13
      file = Tempfile.new('settings_test')
14
      # rubocop:disable LineLength
15
      file.write <<-FILE
16
Name,Count,Value
17
idle_timeout,1,60000
18
FILE
19
      file.rewind
20

    
21
      stdout,stderr = capture {
22
        hammer.run(%W{csv settings --verbose --file #{file.path}})
23
      }
24
      stderr.must_equal ''
25
      lines = stdout.split("\n")
26
      lines[0].must_equal "Updating setting 'idle_timeout'...done"
27
      file.unlink
28
    end
29
  end
30
end