|
22 | 22 |
|
23 | 23 | scenario "choosing to run the code" do |
24 | 24 | in_build_menu { click_on(build_button: "Run") } |
25 | | - within('.output-stdout') do |
| 25 | + within(:output, :stdout) do |
26 | 26 | expect(page).to have_content 'Hello, world!' |
27 | 27 | end |
28 | 28 | end |
29 | 29 |
|
30 | 30 | scenario "choosing to build the code" do |
31 | 31 | in_build_menu { click_on(build_button: "Build") } |
32 | | - within('.output-stderr') do |
| 32 | + within(:output, :stderr) do |
33 | 33 | expect(page).to have_content 'function is never used: `main`' |
34 | 34 | end |
35 | 35 | end |
36 | 36 |
|
37 | 37 | scenario "choosing to test the code" do |
38 | 38 | in_build_menu { click_on(build_button: "Test") } |
39 | | - within('.output-stdout') do |
| 39 | + within(:output, :stdout) do |
40 | 40 | expect(page).to have_content "panicked at 'assertion failed: false'" |
41 | 41 | end |
42 | 42 | end |
|
50 | 50 | scenario "compiling to assembly" do |
51 | 51 | in_build_menu { click_on("assembly") } |
52 | 52 |
|
53 | | - within('.output-code') do |
| 53 | + within(:output, :code) do |
54 | 54 | # We demangle the symbols |
55 | 55 | expect(page).to have_content 'playground::main:' |
56 | 56 |
|
|
67 | 67 | scenario "compiling to assembly" do |
68 | 68 | in_build_menu { click_on("assembly") } |
69 | 69 |
|
70 | | - within('.output-code') do |
| 70 | + within(:output, :code) do |
71 | 71 | # We demangle the symbols |
72 | 72 | expect(page).to have_content 'playground::main:' |
73 | 73 |
|
|
79 | 79 | scenario "compiling to LLVM IR" do |
80 | 80 | in_build_menu { click_on("LLVM IR") } |
81 | 81 |
|
82 | | - within('.output-code') do |
| 82 | + within(:output, :code) do |
83 | 83 | expect(page).to have_content 'ModuleID' |
84 | 84 | expect(page).to have_content 'target datalayout' |
85 | 85 | expect(page).to have_content 'target triple' |
|
89 | 89 | scenario "compiling to MIR" do |
90 | 90 | in_build_menu { click_on("MIR") } |
91 | 91 |
|
92 | | - within('.output-result') do |
| 92 | + within(:output, :result) do |
93 | 93 | expect(page).to have_content 'StorageLive' |
94 | 94 | expect(page).to have_content 'StorageDead' |
95 | 95 | end |
|
102 | 102 |
|
103 | 103 | in_build_menu { click_on("HIR") } |
104 | 104 |
|
105 | | - within('.output-result') do |
| 105 | + within(:output, :result) do |
106 | 106 | expect(page).to have_content 'fn demo() -> /*impl Trait*/ { 42 }' |
107 | 107 | end |
108 | 108 | end |
109 | 109 |
|
110 | 110 | scenario "compiling to WebAssembly" do |
111 | 111 | in_build_menu { click_on("WASM") } |
112 | 112 |
|
113 | | - within('.output-code') do |
| 113 | + within(:output, :code) do |
114 | 114 | expect(page).to have_content '(module' |
115 | 115 | expect(page).to have_content '(block' |
116 | 116 | end |
|
122 | 122 | scenario "it shows the compilation error" do |
123 | 123 | in_build_menu { click_on("MIR") } |
124 | 124 |
|
125 | | - within('.output-stderr') do |
| 125 | + within(:output, :stderr) do |
126 | 126 | expect(page).to have_content 'an unclosed delimiter' |
127 | 127 | end |
128 | 128 | end |
|
0 commit comments