github.com/walf443/mgr@v0.0.0-20150203144449-6f7a3a548462/cli/rails_test.go (about)

     1  package main
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  )
     7  
     8  func TestDetectFramework(t *testing.T) {
     9  	var f RubyOnRailsFramework
    10  	if f.DetectFramework() != false {
    11  		t.Errorf("this directory should not be detected as rails framework")
    12  	}
    13  	err := os.Chdir("railssample")
    14  	if err != nil {
    15  		t.Errorf("Can't change dir to railssample")
    16  	}
    17  
    18  	if !f.DetectFramework() {
    19  		t.Errorf("this directory should be detected as rails framework")
    20  	}
    21  }