1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-05 01:10:18 +00:00

Refactoring: Move dev & prod runmodes to const

This commit is contained in:
Vitaly Velikodny
2015-12-29 21:32:37 +03:00
parent ac3a447479
commit 48fd9675ad
11 changed files with 33 additions and 21 deletions

View File

@ -17,6 +17,8 @@ package config
import (
"os"
"testing"
"github.com/astaxie/beego"
)
var inicontext = `
@ -67,7 +69,7 @@ func TestIni(t *testing.T) {
t.Error(pi)
t.Fatal(err)
}
if iniconf.String("runmode") != "dev" {
if iniconf.String("runmode") != beego.DEV {
t.Fatal("runmode not equal to dev")
}
if v, err := iniconf.Bool("autorender"); err != nil || v != false {

View File

@ -17,6 +17,8 @@ package config
import (
"os"
"testing"
"github.com/astaxie/beego"
)
var jsoncontext = `{
@ -120,7 +122,7 @@ func TestJson(t *testing.T) {
t.Error(pi)
t.Fatal(err)
}
if jsonconf.String("runmode") != "dev" {
if jsonconf.String("runmode") != beego.DEV {
t.Fatal("runmode not equal to dev")
}
if v := jsonconf.Strings("unknown"); len(v) > 0 {

View File

@ -18,6 +18,7 @@ import (
"os"
"testing"
"github.com/astaxie/beego"
"github.com/astaxie/beego/config"
)
@ -65,7 +66,7 @@ func TestXML(t *testing.T) {
t.Error(pi)
t.Fatal(err)
}
if xmlconf.String("runmode") != "dev" {
if xmlconf.String("runmode") != beego.DEV {
t.Fatal("runmode not equal to dev")
}
if v, err := xmlconf.Bool("autorender"); err != nil || v != false {

View File

@ -18,6 +18,7 @@ import (
"os"
"testing"
"github.com/astaxie/beego"
"github.com/astaxie/beego/config"
)
@ -62,7 +63,7 @@ func TestYaml(t *testing.T) {
t.Error(pi)
t.Fatal(err)
}
if yamlconf.String("runmode") != "dev" {
if yamlconf.String("runmode") != beego.DEV {
t.Fatal("runmode not equal to dev")
}
if v, err := yamlconf.Bool("autorender"); err != nil || v != false {