@@ -9,10 +9,21 @@ describe "Lucky CLI", tags: "integration" do
9
9
shell: true ,
10
10
output: io
11
11
)
12
- status.exit_status .should eq(0 )
12
+ status.exit_code .should eq(0 )
13
13
io.to_s.should eq(" Hello World!\n " )
14
14
end
15
15
16
+ it " runs non-compiled tasks" do
17
+ io = IO ::Memory .new
18
+ status = run_lucky(
19
+ args: %w[hello_crystal] ,
20
+ shell: true ,
21
+ output: io
22
+ )
23
+ status.exit_code.should eq(0 )
24
+ io.to_s.should eq(" Hello, Crystal!\n " )
25
+ end
26
+
16
27
it " allows tasks to accept input from STDIN" do
17
28
io = IO ::Memory .new
18
29
run_lucky(
@@ -32,7 +43,7 @@ describe "Lucky CLI", tags: "integration" do
32
43
it " returns the lucky CLI help message when passing the -h flag" do
33
44
io = IO ::Memory .new
34
45
status = run_lucky(args: %w[-h] , shell: true , output: io)
35
- status.exit_status .should eq(0 )
46
+ status.exit_code .should eq(0 )
36
47
io.to_s.should contain(" Usage: lucky [command]" )
37
48
end
38
49
@@ -47,7 +58,7 @@ describe "Lucky CLI", tags: "integration" do
47
58
" LUCKY_TASKS_FILE" => fixtures_tasks_path.to_s,
48
59
}
49
60
)
50
- status.exit_status .should eq(0 )
61
+ status.exit_code .should eq(0 )
51
62
io.to_s.should contain(" Usage: lucky tasks" )
52
63
end
53
64
@@ -61,7 +72,7 @@ describe "Lucky CLI", tags: "integration" do
61
72
" LUCKY_TASKS_FILE" => fixtures_tasks_path.to_s,
62
73
}
63
74
)
64
- status.exit_status .should eq(0 )
75
+ status.exit_code .should eq(0 )
65
76
io.to_s.should contain(" Usage: lucky dev" )
66
77
end
67
78
end
@@ -78,7 +89,7 @@ describe "Lucky CLI", tags: "integration" do
78
89
" LUCKY_TASKS_FILE" => fixtures_tasks_path.to_s,
79
90
}
80
91
)
81
- status.exit_status .should eq(0 )
92
+ status.exit_code .should eq(0 )
82
93
io.to_s.should contain(" Custom help message" )
83
94
end
84
95
end
@@ -99,7 +110,7 @@ describe "Lucky CLI", tags: "integration" do
99
110
args: %w[init.custom test-project --dir my-project] ,
100
111
shell: true ,
101
112
)
102
- status.exit_status .should eq(0 )
113
+ status.exit_code .should eq(0 )
103
114
Dir .cd(" my-project/test-project" ) do
104
115
File .read(" src/shards.cr" ).should contain(" lucky" )
105
116
end
@@ -113,7 +124,7 @@ describe "Lucky CLI", tags: "integration" do
113
124
shell: true ,
114
125
output: io
115
126
)
116
- status.exit_status .should eq(0 )
127
+ status.exit_code .should eq(0 )
117
128
io.to_s.should contain(" Folder named test-project already exists, please use a different name" )
118
129
end
119
130
@@ -124,7 +135,7 @@ describe "Lucky CLI", tags: "integration" do
124
135
shell: true ,
125
136
output: io
126
137
)
127
- status.exit_status .should_not eq(0 )
138
+ status.exit_code .should_not eq(0 )
128
139
io.to_s.should contain(" Project name should only contain lowercase letters, numbers, underscores, and dashes." )
129
140
end
130
141
@@ -135,7 +146,7 @@ describe "Lucky CLI", tags: "integration" do
135
146
shell: true ,
136
147
output: io
137
148
)
138
- status.exit_status .should_not eq(0 )
149
+ status.exit_code .should_not eq(0 )
139
150
io.to_s.should contain(" Projects cannot be named app, app_database, app_server, shards, start_server." )
140
151
end
141
152
end
0 commit comments