This file contains hidden or 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
HTML: | |
<div class="watermarked"><img src="bild.jpeg" /></div> | |
CSS: | |
.watermarked { | |
position: relative; | |
} | |
.watermarked:after { | |
content: "Copyright"; | |
display: inline-block; |
This file contains hidden or 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
#!/usr/bin/env bash | |
echo "require \"./spec/**\"" > run_tests.cr && \ | |
crystal build run_tests.cr -D skip-integration && \ | |
kcov --clean --include-path=$(pwd)/src $(pwd)/coverage ./run_tests && \ | |
bash <(curl -s https://codecov.io/bash) -s $(pwd)/coverage |
This file contains hidden or 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
class BooleanVisitor < Crystal::Visitor | |
def visit(node : Crystal::BoolLiteral) | |
puts "Line: #{node.location.try &.line_number}" | |
puts "Column: #{node.location.try &.column_number}" | |
true | |
end | |
def visit(node : Crystal::ASTNode) | |
true | |
end |
This file contains hidden or 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
require "compiler/crystal/syntax/*" | |
code = <<-CODE | |
def hello | |
true | |
end | |
CODE | |
ast = Crystal::Parser.parse(code) |
This file contains hidden or 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
require "compiler/crystal/syntax/*" | |
code = <<-CODE | |
def hello | |
puts "hello" | |
end | |
CODE | |
ast = Crystal::Parser.parse(code) |
This file contains hidden or 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
# valid.cr | |
def valid? | |
true | |
end | |
# valid_spec.cr | |
require "./valid" | |
require "spec" | |
describe "valid?" do |
This file contains hidden or 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 suite: ✅ | |
Mutations covered by tests: | |
❌ BoolLiteralFlip (x1) | |
The following change didn't fail the test-suite: | |
@@ -1,3 +1,3 @@ | |
def valid? | |
- true | |
+ false | |
end |
This file contains hidden or 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
# valid.cr | |
def valid? | |
true | |
end | |
# valid_spec.cr | |
require "./valid" | |
require "spec" | |
describe "valid?" do |
This file contains hidden or 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
pipelines: | |
default: | |
- step: | |
name: "Run visual regression tests" | |
image: backstopjs/backstopjs:v3.2.15 | |
script: | |
- backstop test | |
- step: | |
name: "Deploy to website" | |
image: fgch/alpine-gitftp |
This file contains hidden or 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
# Create and migrate a new database just for visual regression testing | |
LUCKY_ENV=visual_test lucky db.create && lucky db.migrate | |
# Add one sample post | |
open http://localhost:5000/posts/new | |
# Run the local server with that one sample post | |
LUCKY_ENV=visual_test lucky dev |
NewerOlder