Sha256: 19313d3928bb4126120a33896dfb3ad8a34aa96363940032df15e7709b60bbe1

Contents?: true

Size: 1012 Bytes

Versions: 20

Compression:

Stored size: 1012 Bytes

Contents

require "test_helper"
require "jstdutil/jstestdriver/config"

class JsTestDriverConfigTest < Test::Unit::TestCase
  context "creating JsTestDriverConfig instances" do
    setup do
      @file = "__jstd.conf"
      @server = "http://localhost:4242"
      File.open(@file, "w") { |f| f.puts "server: #{@server}" }
    end

    teardown do
      File.delete(@file) if File.exists?(@file)
    end

    should "work from existing file" do
      config = nil

      assert_nothing_raised do
        config = Jstdutil::JsTestDriver::Config.new @file
      end

      assert_equal @server, config.server
    end

    should "work from string config" do
      config = nil

      assert_nothing_raised do
        config = Jstdutil::JsTestDriver::Config.new "server: #{@server}"
      end

      assert_equal @server, config.server
    end

    should "raise error if no valid configuration is provided" do
      assert_raise ArgumentError do
        Jstdutil::JsTestDriver::Config.new "bogus"
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
jstdutil-0.3.13 test/jstestdriver_config_test.rb
jstdutil-0.3.12 test/jstestdriver_config_test.rb
jstdutil-0.3.11 test/jstestdriver_config_test.rb
jstdutil-0.3.10 test/jstestdriver_config_test.rb
jstdutil-0.3.9 test/jstestdriver_config_test.rb
jstdutil-0.3.8 test/jstestdriver_config_test.rb
jstdutil-0.3.7 test/jstestdriver_config_test.rb
jstdutil-0.3.6 test/jstestdriver_config_test.rb
jstdutil-0.3.5 test/jstestdriver_config_test.rb
jstdutil-0.3.4 test/jstestdriver_config_test.rb
jstdutil-0.3.3 test/jstestdriver_config_test.rb
jstdutil-0.3.2 test/jstestdriver_config_test.rb
jstdutil-0.3.1 test/jstestdriver_config_test.rb
jstdutil-0.3.0 test/jstestdriver_config_test.rb
jstdutil-0.2.2 test/jstestdriver_config_test.rb
jstdutil-0.2.1 test/jstestdriver_config_test.rb
jstdutil-0.2.0 test/jstestdriver_config_test.rb
jstdutil-0.1.2 test/jstestdriver_config_test.rb
jstdutil-0.1.1 test/jstestdriver_config_test.rb
jstdutil-0.1.0 test/jstestdriver_config_test.rb