-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Reuven
committed
Dec 17, 2023
1 parent
dab5bee
commit 8357201
Showing
2 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package load_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
"github.com/tufin/oasdiff/load" | ||
) | ||
|
||
func TestSource_NewStdin(t *testing.T) { | ||
require.True(t, load.NewSource("-").IsStdin()) | ||
} | ||
|
||
func TestSource_NewFile(t *testing.T) { | ||
require.True(t, load.NewSource("../spec.yaml").IsFile()) | ||
} | ||
|
||
func TestSource_String(t *testing.T) { | ||
require.Equal(t, "stdin", load.NewSource("-").String()) | ||
} | ||
|
||
func TestSource_OutStdin(t *testing.T) { | ||
require.Equal(t, `stdin`, load.NewSource("-").Out()) | ||
} | ||
|
||
func TestSource_Out(t *testing.T) { | ||
require.Equal(t, `"http://twitter.com"`, load.NewSource("http://twitter.com").Out()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters