Updating tests for new config output.
This commit is contained in:
		
							parent
							
								
									f6d38def5a
								
							
						
					
					
						commit
						a3d95957dd
					
				|  | @ -7,22 +7,21 @@ class TestConfiguration < Test::Unit::TestCase | |||
|     end | ||||
| 
 | ||||
|     should "fire warning with no _config.yml" do | ||||
|       mock(YAML).load_file(@path) { raise "No such file or directory - #{@path}" } | ||||
|       mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).") | ||||
|       mock($stderr).puts("\tNo such file or directory - #{@path}") | ||||
|       mock(YAML).load_file(@path) { raise SystemCallError, "No such file or directory - #{@path}" } | ||||
|       mock($stderr).puts("Configuration file: none") | ||||
|       assert_equal Jekyll::DEFAULTS, Jekyll.configuration({}) | ||||
|     end | ||||
| 
 | ||||
|     should "load configuration as hash" do | ||||
|       mock(YAML).load_file(@path) { Hash.new } | ||||
|       mock($stdout).puts("Configuration from #{@path}") | ||||
|       mock($stdout).puts("Configuration file: #{@path}") | ||||
|       assert_equal Jekyll::DEFAULTS, Jekyll.configuration({}) | ||||
|     end | ||||
| 
 | ||||
|     should "fire warning with bad config" do | ||||
|       mock(YAML).load_file(@path) { Array.new } | ||||
|       mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).") | ||||
|       mock($stderr).puts("\tInvalid configuration - #{@path}") | ||||
|       mock($stderr).puts("           WARNING: Error reading configuration. Using defaults (and options).") | ||||
|       mock($stderr).puts("Configuration file: (INVALID) #{@path}") | ||||
|       assert_equal Jekyll::DEFAULTS, Jekyll.configuration({}) | ||||
|     end | ||||
|   end | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue