spec
require 'spec_helper'
describe Pyramid::PathInterpolater do
it 'replaces parts with corresponding value' do
result = described_class.('entities/:entity_id', {entity_id: '1'})
expect(result).to eq('entities/1')| module Functional | |
| class Option | |
| def map(fn) | |
| if some? | |
| self.class.some(fn.call(value)) | |
| else | |
| self.class.none(reason) | |
| end | |
| end |
spec
require 'spec_helper'
describe Pyramid::PathInterpolater do
it 'replaces parts with corresponding value' do
result = described_class.('entities/:entity_id', {entity_id: '1'})
expect(result).to eq('entities/1')| enum Result<T> { | |
| case Error(NSError) | |
| case Value(T) | |
| } | |
| getUser(request) { result in | |
| switch result { | |
| case let .Error(error): | |
| // display error message |
| sudo foreman export upstart /etc/init -a [app] -u [user] |
| step "I should be subscribed to captain mode queue events" do | |
| subscription = \ | |
| page.driver.evaluate_script("PrivatePub.subscriptionObjects['/captain']") | |
| expect(subscription).not_to be_nil | |
| end | |
| step "I should be in the room" do | |
| expect(page).to have_selector("#room-#{@room.id}") | |
| expect(URI.parse(page.current_url).fragment).to eq("/rooms/#{@room.id}") | |
| subscription = \ |
| step "I visit the :page_path page" do |path| | |
| path = send(path) unless path.is_a?(String) | |
| visit path | |
| end | |
| step "I click :text" do |text| | |
| click_on text | |
| end | |
| step "I click :text within the :page_element" do |text, element_css| |
| let leftConstraint = NSLayoutConstraint(item: self.containerView, attribute: NSLayoutAttribute.Leading, relatedBy: NSLayoutRelation.Equal, toItem: self.view, attribute: NSLayoutAttribute.Left, multiplier: 1.0, constant: 0) | |
| self.view.addConstraint(leftConstraint) | |
| let rightConstraint = NSLayoutConstraint(item: self.containerView, attribute: NSLayoutAttribute.Trailing, relatedBy: NSLayoutRelation.Equal, toItem: self.view, attribute: NSLayoutAttribute.Right, multiplier: 1.0, constant: 0) | |
| self.view.addConstraint(rightConstraint) |
| #= Paginated | |
| # | |
| # Usage: | |
| # | |
| # customers = store.customers.extend Paginated | |
| # customers.per_page(5) # defaults to 25 | |
| # customers.page(0) # returns an array | |
| # | |
| # count | |
| # where.limit |
| upstream local_3000 { | |
| server 127.0.0.1:3000; | |
| } | |
| server { | |
| server_name 3000.local; | |
| listen 80; | |
| listen 443 default ssl; | |
| send_timeout 3600; # For debugging with breakpoints |
| PROMPT='%{$fg[cyan]%}%~%{$fg_bold[cyan]%}$(git_prompt_info)%{$reset_color%} ' | |
| ZSH_THEME_GIT_PROMPT_PREFIX="(" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX=")" | |
| ZSH_THEME_GIT_PROMPT_DIRTY=" ✗" | |
| ZSH_THEME_GIT_PROMPT_CLEAN=" ✔" |