File: app_config.rb

package info (click to toggle)
camping 3.2.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,312 kB
  • sloc: ruby: 5,032; javascript: 2,362; makefile: 29
file content (28 lines) | stat: -rw-r--r-- 805 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'test_helper'
require 'camping'

module Config end

class Config::Test < TestCase

  def before_all
    write_config()
    Camping.goes :Config
    @options = Camping::Apps.select{|a| a.name == "Config" }.first.options
  end

  def after_all
    trash_config()
  end

  def test_config
    assert @options.has_key? :hostname
    assert @options.has_key? :friends
    assert_equal @options[:friends].first, "_why", "_why isn't here?"
    assert_equal @options[:friends].length, 3, "Where are all our friends?"
    assert_equal @options.has_key?(:database), true, "By Golly the Database settings are missing."
    assert_equal @options[:database].length, 4, "We're missing some database settings."
    assert_equal @options[:database][:adapter], "sqlite3", "sqlite is missing. Not good."
  end

end