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
tell application "Google Chrome" | |
set allUrls to {} | |
repeat with theWindow in every window | |
set urlsInWindow to {} | |
repeat with theTab in every tab of theWindow | |
set currentUrl to the theTab's URL | |
set urlsInWindow to urlsInWindow & {currentUrl} | |
end repeat | |
set allUrls to allUrls & {urlsInWindow} | |
end repeat |
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
<?php | |
public function test_it_sets_the_full_name() { | |
$subject = new User(); | |
$name = "Peter"; | |
$subject->setFirstname($name); | |
$this->assertEquals($name, $subject->getFirstname()); | |
} |
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
<?php | |
public function test_it_sets_the_full_name() { | |
$subject = new User(); | |
$subject->setFirstname("Peter"); | |
$this->assertEquals("Peter", $subject->getFirstname()); | |
} |
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
private def single_post(post : Post) | |
article do | |
header class: "post-title" do | |
h2 do | |
text post.title | |
link "#", to: Blog::Posts::Show.with(post.slug) | |
end | |
post_meta(post) | |
end | |
content(post) |
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
def __render_row(self, row): | |
self.__render_project_name(row) | |
+ self.__render_project_status(row) | |
+ | |
+ def __render_project_status(self, row): | |
+ start_y = (row[0] + 1) * self.__row_height() | |
+ badge_width = 150 | |
+ padding = 10 | |
+ pos = (self.__from_right(badge_width), start_y + padding, self.__from_right(padding), start_y + self.__row_height() - padding) | |
+ self.draw.rectangle(pos, outline = self.BLACK) |
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
padding = 10 | |
pos = (self.__from_right(badge_width), start_y + padding, self.__from_right(padding), start_y + self.__row_height() - padding) | |
self.draw.rectangle(pos, outline = self.BLACK) | |
- self.draw.text((self.__from_right(badge_width + 35), start_y + 17), self.PASSED, font = self.badge_font, fill = self.BLACK) | |
+ self.draw.text((self.__from_right(badge_width - 35), start_y + 17), self.PASSED, font = self.badge_font, fill = self.BLACK) | |
def __render_project_name(self, row): | |
index = row[0] |
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
# Install backstopjs locally | |
yarn add backstopjs | |
# Setup folders, configuration etc. | |
./node_modules/.bin/backstopjs init | |
# Edit backstop.json to configure the viewports you want to test on. | |
# I use the following: | |
# "viewports": [ | |
# { |
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 |
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
# valid.cr | |
def valid? | |
true | |
end | |
# valid_spec.cr | |
require "./valid" | |
require "spec" | |
describe "valid?" do |
OlderNewer