text stringlengths 10 2.61M |
|---|
require File.dirname(__FILE__) + '/test_helper'
class SitemapGeneratorTest < Test::Unit::TestCase
context "SitemapGenerator Rake Task" do
setup do
::Rake::Task['sitemap:refresh'].invoke
end
should "fail if hostname not defined" do
end
end
context "SitemapGenerator library" do
shou... |
# frozen_string_literal: true
module Dry
# Helper methods for constraint types
#
# @api public
module Types
# @param [Hash] options
#
# @return [Dry::Logic::Rule]
#
# @api public
def self.Rule(options)
rule_compiler.(
options.map { |key, val|
::Dry::Logic::Rule::... |
class EditAndAddColumnsToMembers < ActiveRecord::Migration
def change
add_column :members, :firstname, :string
add_column :members, :lastname, :string
remove_column :members, :name
end
end
|
# Copyright 2013 Sami Samhuri <sami@samhuri.net>
#
# MIT License
# http://sjs.mit-license.org
module Kwikemon
class Monitor
DefaultTTL = 86400 # 1 day
attr_accessor :redis
attr_reader :name, :text, :ttl, :created, :modified
@listeners = Hash.new { |h, k| h[k] = [] }
def Monitor.on(event, &bl... |
class RemoveShiftsFromJobs < ActiveRecord::Migration[5.2]
def change
remove_column :jobs, :shifts
end
end
|
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongsnamee the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# ... |
require 'rails_helper'
describe 'leagues/show' do
let(:league) { build_stubbed(:league) }
let(:divisions) { build_stubbed_list(:league_division, 3) }
let(:roster) { build_stubbed(:league_roster) }
let(:matches) do
[
build_stubbed(:league_match, status: :confirmed),
build_stubbed(:league_match, ... |
# Returns true if we are running on a MS windows platform, false otherwise.
def Kernel.is_windows?
(RUBY_PLATFORM =~ /mswin32/) != nil
end
|
module Alf
module Iterator
module ClassMethods
#
# Coerces something to an iterator
#
def coerce(arg, environment = nil)
case arg
when Iterator, Array
arg
when String, Symbol
Proxy.new(environment, arg.to_sym)
else
Reader.coer... |
unless ARGV.length == 2
puts "Usage: ruby #{$0} <dictionary> <numbers>"
exit 1
end
unless File.exists? dict_filepath = ARGV[0]
puts "Dictionary file #{dict_filepath} does not exist"
exit 1
end
unless File.exists? numbers_filepath = ARGV[1]
puts "Numbers file #{numbers_filepath} does not exist"
... |
require "hodor"
module Hodor
class CLI
def call(argv)
case argv[0]
when "build"
build
else
fail "Unknown command #{argv[0]}"
end
end
def build
builder.build
end
protected
def builder
@builder ||= Hodor::Builder.new(Dir.pwd)
end
end
... |
class Addtimestamps < ActiveRecord::Migration[5.2]
def change_tabel
add_timestamps(:users)
add_timestamps(:bands)
end
end
|
require 'rails_helper'
RSpec.describe ImportCsvContactsJob, type: :job do
let(:uploaded_file) { create(:uploaded_file, :with_attachment) }
let(:user) { uploaded_file.user }
let(:params) {
{
address: "address",
birth_date: "birth_date",
credit_card: "credit_card",
email: "email",
... |
component "component1" do |pkg, settings, platform|
pkg.version "1.2.3"
pkg.md5sum "abcd1234"
pkg.url "http://my-file-store.my-app.example.com/component1-1.2.3.tar.gz"
pkg.mirror "http://mirror-01.example.com/component1-1.2.3.tar.gz"
pkg.mirror "http://mirror-02.example.com/component1-1.2.3.tar.gz"
pkg.mirr... |
describe "integer_math.rb" do
it "should output '1'", points: 1 do
math_file = "integer_math.rb"
file_contents = File.read(math_file)
File.foreach(math_file).with_index do |line, line_num|
if line.include?("p") || line.include?("puts")
expect(line).to_not match(/1/),
"Expected 'in... |
module Webapp
##Exceptions for the web App.
## TODO: Check what is the best base Exception
class NotAllowedError < StandardError
end
class FBUserNotAuthenticableError < StandardError
end
class FBUserNotRegisteredError < StandardError
end
class NoFBSessionError < St... |
class CareMonth < ApplicationRecord
has_many :baby_cares, dependent: :destroy
end
|
require './lib/game.rb'
describe Game do
subject(:g) {Game.new(2, 100)}
it "should initialize 2 players" do
g.players.length.should == 2
end
it "should give the players 5 cards" do
g.players[0].hand.cards_in_hand.length.should == 5
end
end
|
class CompaniesController < ResourceController
before_action :build_user, only: :new
#rspec remaining
skip_load_resource only: :create
def index
@search = Company.search(params[:q])
@companies = @search.result.includes(:owner).page(params[:page])
end
def create
@company = Company.new(company_p... |
# -*- coding: utf-8 -*-
require 'spec_helper'
require 'ostruct'
require 'flail/backtrace'
require 'flail/exception'
describe Flail::Exception do
#Setup flail with dummy handler as these tests aren't very complex.
Flail.configure do
handle do |payload|
# Do nothing.
end
end
subject { Flail::E... |
if ENV['__test_coverage__']
require 'simplecov'
SimpleCov.start do
add_filter '/autotest/'
add_filter '/config/'
add_filter '/db/'
add_filter '/deploy/'
add_filter '/doc/'
add_filter '/features/'
add_filter '/lib/jobs/'
add_filter '/lib/tasks/'
add_filter '/log/'
add_filter '... |
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "sysloggly/version"
Gem::Specification.new do |spec|
spec.name = "sysloggly"
spec.version = Sysloggly::VERSION
spec.licenses = ["MIT"]
spec.authors = ["Joergen Dahlke"]
spec.email ... |
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Available Boxes: https://atlas.hashicorp.com/search
config.vm.box = "ubuntu/xenial64"
# Virtual Machine will be available at 10.10.10.15
config.vm.network "private_network", ip: "10.10.10.15"
# Synced folder
config.vm.synced_fo... |
class CreateCharges < ActiveRecord::Migration
def change
create_table :charges do |t|
t.integer :customer_id, null: false
t.integer :created, null: false
t.boolean :paid, null: false
t.integer :amount, null: false
t.string :currency, null: false
t.boolean :refunded, null: false... |
# encoding: utf-8
control "V-52445" do
title "The DBMS software libraries must be periodically backed up."
desc "Information system backup is a critical step in maintaining data assurance and availability.
System-level information includes: system-state information, operating system and application software, and l... |
# migrations are used to change the structure of the database. for example: creating tables. dropping tables, adding colums to tables, removing colums from tables. adding indexes, remove indexes
class CreateQuestions < ActiveRecord::Migration
def change
create_table :questions do |t|
t.string :title
t... |
require 'setback/base'
describe Setback::Base do
subject do
Class.new do
include Setback::Base
end.new
end
it 'should proxy #[] to provider#get' do
subject.provider.should_receive(:get).with(:foo).and_return(:bar)
subject[:foo].should == :bar
end
it 'should proxy #[]= to provider#set'... |
require_relative 'installer_errors'
class InstallerIO
def initialize(silent=false)
@silent = !!silent
end
def silent?
@silent
end
def log(text)
puts text
end
def prompt(message, default=nil)
print "\n#{MESSAGES[message]}#{default.nil? ? '' : " [#{default}]"}: "
get_input
end
d... |
require_relative "sha256lib.rb"
# ----------
# hash256.rb - The hash function used in Bitcoin. Basically just runs sha256.rb twice.
# ----------
# Command Line Arguments
$input = ARGV[0] || "0x0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb... |
module Viberroo
##
# This class' methods serve as declarative wrappers with predefined types for
# each message type Viber API offers.
#
# @see https://developers.viber.com/docs/api/rest-bot-api/#message-types
#
class Message
##
# Simple text message.
#
# @example
# message = Viber... |
class TournamentGroup < ApplicationRecord
belongs_to :tournament
has_many :tournament_rounds
has_many :matches, through: :tournament_rounds
has_many :teams, through: :tournament_rounds
def teams
tournament_rounds.map(&:teams).flatten.uniq
end
end
|
# TODO: update employee_create_params so that password is random
class EmployeesController < ApplicationController
before_action :logged_in_user
before_action :correct_user_or_admin, only: [:show, :edit, :update]
before_action :admin_employee_user, only: [:index, :new, :create, :delete]
before_action :not_self... |
module Views
RSpec.describe Text do
let(:text) { "Some really cool text" }
subject { Text.new(text) }
it_behaves_like "Views::Base"
it "sets the text correctly" do
expect(subject.text).to eq(text)
end
describe "#setup_bottom_right_screen_rect" do
it "has the expected sizing" do... |
module Parcel
class Runner
def self.install
exec_with_sym(:yarn, :add, 'parcel-bundler')
end
def self.watch
exec_parcel(:watch)
end
def self.build
exec_parcel(:build)
end
def self.serve
exec_parcel(:serve)
end
def self.clobber
clean(Configuration.o... |
class Gitapi
URL = "https://api.github.com/users"
attr_reader :users, :search
def initialize search
@search = search
@users = []
values = {owner: search, type: "xml"}
url = [URL, "?", values.to-query].join
response = HTTParty.get(url).body
xml = Nokogiri::XML(response)
xml.xpa... |
class CreateFulfillments < ActiveRecord::Migration[5.0]
def change
create_table :fulfillments, id: :uuid do |t|
t.belongs_to :orders, index: true, type: :uuid
t.integer :status
t.string :tracking_company
t.string :tracking_number
t.timestamps
end
end
end
|
class UnitTestRunner
def self.ironruby?
defined?(RUBY_ENGINE) and RUBY_ENGINE == "ironruby"
end
def parse_options(args)
require "optparse"
pass_through_args = false
parser = OptionParser.new(args) do |opts|
opts.banner = "USAGE: utr libname [-a] [-l] [-g] [-i] [-t TestClass#test_method] [... |
# frozen_string_literal: true
require "test_helper"
class DuckDuckGoTest < Minitest::Test
test "detects DuckDuckGo on iOS device" do
browser = Browser.new(Browser["DUCKDUCKGO_BROWSER_IOS"])
assert browser.duck_duck_go?
refute browser.safari?
refute browser.chrome?
assert browser.webkit?
refu... |
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :customer do
people_type "MyString"
title_partner nil
observation "MyText"
partner nil
agreement nil
agreement_number 1
email "MyString"
active_record false
end
end
|
class Request < ActiveRecord::Base
belongs_to :user
belongs_to :host, class_name: 'User'
end
|
class Review < ActiveRecord::Base
include Protocols::Shareable
def shareable?
status.active? && super
end
delegate :title, :to => :product
alias_attribute :description, :content
alias_attribute :user_generated_content, :sound_bite
def media
product.local_photos.primary || product.re... |
require 'spec_helper'
describe FuelSDK::HTTPRequest do
let(:client) { Class.new.new.extend FuelSDK::HTTPRequest }
subject { client }
it { should respond_to(:get) }
it { should respond_to(:post) }
it { should respond_to(:patch) }
it { should respond_to(:delete) }
it { should_not respond_to(:request) } # p... |
# frozen_string_literal: true
require "rails_helper"
module Renalware
module Diaverum
module Incoming
module Nodes
describe Node do
subject(:node) { described_class.new(xml.root) }
let(:xml) do
Nokogiri::XML(<<-XML)
<SomeElement>
<SomeAttr... |
require 'rails_helper'
RSpec.describe Teacher, type: :model do
describe '#subject_name' do
let(:subject) { create(:subject) }
let(:teacher) { create(:teacher, subject: subject) }
it "returns subject's name" do
expect(teacher.subject_name).to eq(subject.name)
end
end
end
|
class Node
attr_accessor :name, :parent
attr_reader :children
def initialize(name)
@name = name
@children = []
end
def add_child(node)
@children << node
node.parent = self
end
alias << add_child
def remove_child(node)
@children.delete node
end
def [](index)
@children[ind... |
require "spec_helper"
describe Booking, type: :request do
context "when authenticated" do
before do
@coach = create(:coach)
user = create(:user)
login(user)
create(:availability,
coach: @coach,
duration: 60)
@booking = create(:booking,
... |
require "test_helper"
require "fluent/plugin/buf_file"
module Fluentd::Setting
class OutS3Test < ActiveSupport::TestCase
setup do
@klass = Fluentd::Setting::OutS3
@valid_attributes = {
s3_bucket: "bucketname"
}
@instance = @klass.new(@valid_attributes)
end
sub_test_case "... |
module GoogleAnalyticsEventsHelper
def track_home_ga_event(controller, action)
@ga_events ||= []
case controller
when 'home'
@ga_events.push("pageTracker._trackEvent('#{controller.titleize}', '#{action}');")
end
end
def track_where_ga_event(controller, localities)
@ga_events |... |
class AddOfferToCoupons < ActiveRecord::Migration
def change
add_column :coupons, :offer, :string
end
end
|
require 'spec_helper'
describe CastablesController do
include Devise::TestHelpers
before(:each) do
sign_in_user :maintainer
end
describe "GET index" do
def stub_index
Castable.stub(:all => mock_castables)
end
it "assigns all castables as @castables" do
stub_index
g... |
require 'rails_helper'
RSpec.describe 'readiness survey page', :onboarding do
let(:owner) { account.owner }
let(:companion) { account.companion }
context 'for a solo account' do
let(:account) { create_account(:eligible, onboarding_state: 'readiness') }
before do
login_as_account(account)
vi... |
class CreateParshas < ActiveRecord::Migration
def change
create_table :parshas do |t|
t.string :name
t.boolean :available, :default => true
t.integer :people_id
t.integer :past_id
t.integer :sefer_id
t.date :date
t.timestamps null: true
end
end
end
|
module Taskmgr
module Core
class Task
attr_reader :title, :description, :due_date, :category
def initialize
@title = ""
@description = ""
@parent = nil
@due_date = nil
@subtasks = Array.new
... |
# frozen_string_literal: true
# Image paths with different compression
class Image < ApplicationRecord
has_many :image_product_items, dependent: :delete_all
has_many :product_items, through: :image_product_items
validates :full_webp, presence: true
validates :full_jpegxr, presence: true
validates :full_jpeg... |
class Tutorial < ApplicationRecord
validates :title, length: { minimum: 5 }
validates :description, length: { minimum: 10 }
has_many :videos, -> { order(position: :ASC) }, dependent: :destroy
acts_as_taggable_on :tags, :tag_list
accepts_nested_attributes_for :videos
scope :classroom, -> { where(classroom:... |
module Hippo::Segments
class ISA < Base
segment_identifier 'ISA'
segment_fixed_width
field :name => 'AuthorizationInformationQualifier',
:datatype => :list,
:list => [ '00','01','02','03','04','05','06'],
:maximum => 2,
:required => false
... |
require 'rails_helper'
describe 'meta/games/show' do
let(:game) { build_stubbed(:game) }
it 'shows data' do
assign(:game, game)
render
expect(rendered).to include(game.name)
end
end
|
require 'spec_helper'
describe CanvasStatsd::RequestTracking do
describe '#enable' do
it 'should delegate log messages to the optional logger' do
log_double = double()
expect(log_double).to receive(:info)
CanvasStatsd::RequestTracking.enable logger: log_double
CanvasStatsd::RequestTracki... |
require 'dist_server/util/array'
class Hash
end
class FSInputStream
def read_hash
size = self.read_uint16
hash = {}
for i in 0...size
key = self.read_string
value = self.read_type_val
hash[key] = value
end
hash
end
end
class FSOutputStream
def write_hash(hash)
self.write_uint16(hash.s... |
require 'steam'
class Participant < ActiveRecord::Base
include ApplicationHelper
include HeroesHelper
belongs_to :match
belongs_to :player, :class_name => "Player", :foreign_key => "player_id"
belongs_to :hero
def hero
Steam::Constants::Heroes[self.hero_id]
end
def winner
self.match.winner... |
class SessionsController < ApplicationController
layout false
skip_before_filter :authenticate
def create
if authorize(request.env['omniauth.auth'])
flash[:notice] = "Logged in as #{session[:employee][:name]}."
else
flash[:error] = "Please log in using a Shopify account."
end
redirect... |
require_relative 'Validations'
class User
include Validator
attr_accessor :user_credits, :score, :credits
attr_reader :name, :inital_credits
REWARD = 0.25
@score = @credits = nil
def initialize name:, user_credits:
# p user_credits, name
@inital_credits = @user_credits = use... |
require 'orocos/test'
module Orocos
describe "logging" do
attr_reader :orogen_project, :orogen_deployment, :process
before do
@orogen_project = OroGen::Spec::Project.new(Orocos.default_loader)
@orogen_deployment = orogen_project.deployment('test')
@process = Proce... |
class UsersArtistItemsTag < ActiveRecord::Base
belongs_to :user
belongs_to :artist_item
belongs_to :tag
end
|
#!/usr/bin/env ruby
# action.rb
# createdby: Micah Rosales
# modified: 12/27/14
#
# Called by an alfred workflow with a JSON blob
# as the first argument. Parameter must have a
# type field and a arg field
require "json"
# Copies the given string to the OSX system
# clipboard using pbcopy and piping to stdin
def pb... |
module Setback
class MemoryProvider
def initialize(settings_hash = {})
@settings_hash = settings_hash
end
def get(key)
@settings_hash[key]
end
def set(key, value)
@settings_hash[key] = value
end
def keys(filter_internal = true)
@settings_hash.keys
end
de... |
# encoding: binary
require "amq/protocol/client"
# We will need to introduce concept of mappings, because
# AMQP 0.9, 0.9.1 and RabbitMQ uses different letters for entities
# http://dev.rabbitmq.com/wiki/Amqp091Errata#section_3
module AMQ
module Protocol
class Table
class InvalidTableError < StandardError... |
Given(/^I am a new customer who is enrolled in online servicing$/) do
on(LoginPage) do |page|
login_data = page.data_for(:td_non_cycled_account)
username = login_data['username']
password = login_data['password']
ssoid = login_data['ssoid']
page.login(username, password, ssoid)
end
end
Given(/^... |
module SimpleTableFor
class Defaults
def self.get
@defaults || {}
end
def self.set(options)
@defaults = options
end
end
end
|
class Animal
attr_reader :name
attr_accessor :mood
def initialize(name)
# binding.pry
puts "I'm an animal"
@name = name
@mood = 'nervous'
end
def speak
puts 'just a plain animal here. sorry.'
end
end |
class TimeTrackerCategory < ActiveRecord::Base
unloadable
include Redmine::SafeAttributes
safe_attributes 'name','parent_id'
validates_length_of :name, :maximum => 255
validate :validate_exist_parent_id
validate :validate_not_parent, on: :update
before_validation :require_before_save_parent_id
def v... |
require 'pg'
class Peep
attr_reader :content, :created_at, :id
def initialize(content:, id:, created_at:)
@content = content
@id = id
@created_at = created_at
end
def self.all
result = DatabaseConnection.query("SELECT * FROM peeps ORDER BY id DESC;")
result.map do |peep|
Peep.new(
... |
# encoding: utf-8
##
# Backup Generated: nyc_collegeline_production_backup
# Once configured, you can run the backup with the following command:
#
# $ backup perform -t nyc_collegeline_production_backup [-c <path_to_configuration_file>]
#
# For more information about Backup's components, see the documentation at:
# ht... |
class RubricsController < ApplicationController
before_action :find_rubric, only: [:show, :update, :destroy]
def index
@rubrics = Rubric.all
@rubrics = @rubrics.where('lower(rubrics.title) LIKE ?', "%#{params[:search_string].downcase}%") if params[:search_string]
paginate json: ActiveModelSerializers... |
module Fog
module Storage
class GoogleJSON
class Real
# Get an expiring object url from Google Storage for putting an object
# https://cloud.google.com/storage/docs/access-control#Signed-URLs
#
# @param bucket_name [String] Name of bucket containing object
# @param ob... |
class Game < ActiveRecord::Base
MAX_PLAYERS = 4
MIN_PLAYERS = 4
HAND_SIZE = 10
TARGET_SCORE = 500
has_many :players, dependent: :destroy
has_many :rounds, dependent: :destroy
def finished?
odd_players_score.abs >= TARGET_SCORE || even_players_score.abs >= TARGET_SCORE
end
def active_... |
require 'find'
class Bolts < Thor::Group
include Thor::Actions
argument :group, :default => "", :desc => "leave blank for all"
desc "choose which group of bolts you would like to install"
def install
dir_path = [".", "/#{group}"].join
Find.find(dir_path) do |bolt|
if File.extname(bolt).eql?(".tho... |
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe User, type: :model do
let(:user) { build(:user) }
context 'associations' do
it { should have_many(:post_types) }
it { should have_many(:posts).through(:post_types) }
end
end
|
# a method that returns the sum of two integers
=begin
START
# Given two integers
SET number1 = the first integer
SET number2 = the second integer
SET sum = READ number1 + READ number2
PRINT sum
END
=end
# a method that takes an array of strings, and returns a string that is all those strings concatenated together
=be... |
RSpec.describe CopyrightNoticesHelper do
before do
allow(Time).to receive(:now).and_return(Time.new(2014,1,1,0,0))
end
context "when the start year is the current year" do
let :correct_format do
"© 2014 Toggle Professional Services LLC"
end
it "formats correctly" do
expect(helpe... |
Before do |scenario|
LOG.info("Starting : #{scenario.name}")
$helper.go_to(LOGIN_URL)
sleep 2
end
After do |scenario|
LOG.info("Result : #{scenario.passed?} - #{scenario.name}")
if scenario.exception
LOG.info("The full exception is : #{scenario.exception.inspect}")
LOG.info("Backtrace is : #{scenario... |
class CommentsController < ApplicationController
#before_action :authenticate_user!
def create
@article = Article.find(params[:comment][:article_id])
@comment = @article.comments.build(comment_params)
@comment.user = current_user
@comment.save
respond_to do |format|
format.html { redi... |
class CreateMeasurements < ActiveRecord::Migration
def change
create_table :measurements do |t|
t.belongs_to :user, index: true, foreign_key: true
t.belongs_to :act_indicator_relation, index: true, foreign_key: true
t.datetime :date
t.decimal :value
t.text :details
t.boolean :a... |
module MongoDoc
module Railties
module Config
extend self
def config(app)
MongoDoc::Connection.config_path = app.root + 'config/mongodb.yml'
MongoDoc::Connection.default_name = "#{app.root.basename}_#{Rails.env}"
MongoDoc::Connection.env = Rails.env
end
end
end
end... |
class AddingFieldsToProduct < ActiveRecord::Migration
def change
add_column :products, :length, :string
add_column :products, :author_desc, :text
add_column :products, :author_image_n, :string
end
end
|
module Analyst
module Entities
class Root < Entity
handles_node :analyst_root
def full_name
""
end
def inspect
"\#<#{self.class}>"
end
def contents
@contents ||= actual_contents.map do |child|
# skip top-level CodeBlocks
child.i... |
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel... |
# vim: ts=2:sw=2:softtabstop=2:et
require 'cinch'
require 'plugin_helpers'
class Learn
include Cinch::Plugin, SlackCat::PluginHelpers
match /learn ([^ ]*) (.*)?/i, prefix: ".", method: :learn
match /(.*)?/i, prefix: ".", method: :respond
match /learned/i, prefix: ".", method: :learned
def respond(memo, comm... |
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable,
:validatable, :authentication_keys => [:login]
has_many :volunteer_commitments
has_many :user_skills
has_many :skills, through: :user_skills
has_many :user_issues
h... |
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VA... |
require 'spec_helper'
describe Apohypaton::Config do
context "#chroot" do
subject { config.chroot }
let(:config) { Apohypaton::Config.new }
context "with a app_name and DEPLOY_ENV" do
let(:app_name) { "no" }
before do
ENV['DEPLOY_ENV'] = 'testing'
config.app_name = app_name
... |
#!/usr/bin/ruby
require 'yaml'
require "#{File.dirname(__FILE__)}/lib/array_extender.rb"
c = YAML.load_file("#{File.dirname(__FILE__)}/config.yml")
ENTRIES = 9
HEADER = ",%usr,%nice,%sys,%iowait,%irq,%soft,%steal,%guest,%idle,%all\n"
avg = File.new("mpstat_baremetal_avg.csv", 'w')
avg.write HEADER
arr_usr = []
ar... |
class CreateAffordances < ActiveRecord::Migration
def change
create_table :affordances do |t|
t.string :type
t.boolean :verified
t.json :details
t.references :matrix_entry, index: true, foreign_key: true
t.timestamps null: false
end
end
end
|
describe GitHubChangelogGenerator::Parser do
describe ".user_project_from_remote" do
context "when remote is type 1" do
subject { GitHubChangelogGenerator::Parser.user_project_from_remote("origin https://github.com/skywinder/ActionSheetPicker-3.0 (fetch)") }
it { is_expected.to be_a(Array) }
it... |
class RequestedTweetResponder < ApplicationResponder
topic :requested_tweet
def respond(data)
respond_to :requested_tweet, data
end
end |
# rubocop:todo all
shared_context 'auth unit tests' do
let(:generation_manager) do
Mongo::Server::ConnectionPool::GenerationManager.new(server: server)
end
let(:pool) do
double('pool').tap do |pool|
allow(pool).to receive(:generation_manager).and_return(generation_manager)
end
end
let(:con... |
require_relative('array_element_expr')
require_relative('assignment_expr/div_assignment_expr')
require_relative('constant_expr/constant_expr')
class ArrayAssignmentExpr < ArrayElementExpr
def initialize(array_id, index, ass_op, ass_expr, lineno)
@ass_op = ass_op
@ass_expr = ass_expr
super(array_id, index... |
require 'rails_helper'
RSpec.describe Purchase, type: :model do
before do
@purchase = FactoryBot.build(:purchase)
end
describe "商品購入情報の保存" do
context "購入情報が保存できるとき" do
it "token, postal_code, city, house_number, building, prefecture_id, phone_number, item_id, user_idの値が存在する" do
expe... |
require 'test_helper'
class PadreadoresControllerTest < ActionDispatch::IntegrationTest
setup do
@padreador = padreadores(:one)
end
test "should get index" do
get padreadores_url
assert_response :success
end
test "should get new" do
get new_padreador_url
assert_response :success
end
... |
# encoding: utf-8
describe Faceter::Functions, ".split" do
let(:arguments) { [:split, Selector.new(options)] }
let(:input) { { foo: :FOO, bar: :BAR, baz: :BAZ } }
it_behaves_like :transforming_immutable_data do
let(:options) { {} }
let(:output) { [{ foo: :FOO, bar: :BAR, baz: :BAZ }, {}] }
end
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.