source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/features/support/env.rb | Ruby | mit | 4,885 | main | 383 | # frozen_string_literal: true
require "bundler/setup"
# We're injecting simplecov_config via aruba in cucumber here
# depending on what the test case is...
begin
require File.join(File.dirname(__FILE__), "simplecov_config")
rescue LoadError
warn "No SimpleCov config file found!"
end
$LOAD_PATH.unshift(File.join(... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/features/step_definitions/my_steps.rb | Ruby | mit | 4,885 | main | 729 | # frozen_string_literal: true
Given(/^I want to keep stuff simple$/) do
expect(1).to eq(1)
end
When(/^I write my cukes for the fake project$/) do
expect(1).to eq(1)
end
Then(/^I make all necessary tests in a single step$/) do
expect(FakedProject.foo).to eq("bar")
expect(FrameworkSpecific.cucumber).to eq("On... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/test/meta_magic_test.rb | Ruby | mit | 4,885 | main | 425 | # frozen_string_literal: true
require_relative "test_helper"
class MetaMagicTest < Test::Unit::TestCase
def test_class_methods
assert_equal "this is a mixed-in class method", FakedProject.a_class_method
end
def test_instance_methods
p = FakedProject.new
assert_equal "this is a mixed-in instance met... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/test/faked_test.rb | Ruby | mit | 4,885 | main | 284 | # frozen_string_literal: true
require_relative "test_helper"
class FakedTest < Test::Unit::TestCase
def test_something
assert_equal "bar", FakedProject.foo
end
def test_framework_specific
assert_equal "Only tested in Test/Unit", FrameworkSpecific.test_unit
end
end |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/test/test_helper.rb | Ruby | mit | 4,885 | main | 335 | # frozen_string_literal: true
require "bundler/setup"
# We're injecting simplecov_config via aruba in cucumber here
# depending on what the test case is...
begin
require File.join(File.dirname(__FILE__), "simplecov_config")
rescue LoadError
warn "No SimpleCov config file found!"
end
require "faked_project"
requi... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/test/some_class_test.rb | Ruby | mit | 4,885 | main | 303 | # frozen_string_literal: true
require_relative "test_helper"
class SomeClassTest < Test::Unit::TestCase
def setup
@instance = SomeClass.new("foo")
end
def test_reverse
assert_equal "oof", @instance.reverse
end
def test_comparison
assert @instance.compare_with("foo")
end
end |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/lib/faked_project.rb | Ruby | mit | 4,885 | main | 354 | # frozen_string_literal: true
class FakedProject
def self.foo
"bar"
end
end
Dir[File.join(File.dirname(__FILE__), "faked_project/*.rb")].reject { |f| /untested/.match(f) }.each do |file|
require file # Require all source files in project dynamically so we can inject some stuff depending on test situation
en... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/lib/faked_project/meta_magic.rb | Ruby | mit | 4,885 | main | 492 | # frozen_string_literal: true
module MetaMagic
module ClassMethods
def a_class_method
"this is a mixed-in class method"
end
end
module InstanceMethods
def an_instance_method
"this is a mixed-in instance method"
end
end
def self.included(base)
base.send :extend, ClassMethods
... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/lib/faked_project/framework_specific.rb | Ruby | mit | 4,885 | main | 401 | # frozen_string_literal: true
# A pile of methods that only get tested in their frameworks
# and thus make this file only 100% covered when all framework test
# results are merged
module FrameworkSpecific
class << self
def cucumber
"Only tested in Cucumber"
end
def rspec
"Only tested in RSpe... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/lib/faked_project/some_class.rb | Ruby | mit | 4,885 | main | 395 | # frozen_string_literal: true
class SomeClass
attr_reader :label
attr_accessor :some_attr
def initialize(label)
@label = label
end
def reverse
label.reverse
end
def compare_with(item)
if item == label
true
else
raise "Item does not match label"
end
rescue StandardErro... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/lib/faked_project/untested_class.rb | Ruby | mit | 4,885 | main | 213 | # frozen_string_literal: true
class UntestedClass
def initialize(yogurts)
@yogurts = yogurts
end
def power_level
@yogurts.map do |yo|
yo.experience_points**2
end.reduce(0, &:+)
end
end |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/minitest/test_helper.rb | Ruby | mit | 4,885 | main | 318 | # frozen_string_literal: true
require "bundler/setup"
# We're injecting simplecov_config via aruba in cucumber here
# depending on what the test case is...
begin
require File.join(File.dirname(__FILE__), "simplecov_config")
rescue LoadError
warn "No SimpleCov config file found!"
end
require "minitest/autorun" |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/minitest/some_test.rb | Ruby | mit | 4,885 | main | 318 | # frozen_string_literal: true
require "test_helper"
require "faked_project/some_class"
class SomeTest < Minitest::Test
def setup
@instance = SomeClass.new("foo")
end
def test_reverse
assert_equal "oof", @instance.reverse
end
def test_comparison
assert @instance.compare_with("foo")
end
end |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/faked_project/minitest/other_test.rb | Ruby | mit | 4,885 | main | 474 | # frozen_string_literal: true
require "bundler/setup"
begin
require File.expand_path("simplecov_config", __dir__)
rescue LoadError
warn "No SimpleCov config file found!"
end
require "minitest/autorun"
require "faked_project/some_class"
class OtherTest < Minitest::Test
def setup
@instance = SomeClass.new("... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/rails/rspec_rails/Gemfile | Ruby | mit | 4,885 | main | 1,891 | # frozen_string_literal: true
source "https://rubygems.org"
# added gems
gem "logger"
gem "rspec-rails"
gem "simplecov", path: "../../.."
if defined?(JRUBY_VERSION)
gem "activerecord-jdbcsqlite3-adapter", "~> 61.0", platform: :jruby
else
gem "sqlite3", "~> 1.4"
end
# Bundle edge Rails instead: gem 'rails', git... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/rails/rspec_rails/Rakefile | Ruby | mit | 4,885 | main | 227 | # Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require_relative 'config/application'
Rails.application.load_tasks |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/rails/rspec_rails/app/jobs/application_job.rb | Ruby | mit | 4,885 | main | 269 | class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
# Most jobs are safe to ignore if the underlying records are no longer available
# discard_on ActiveJob::DeserializationError
end |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/rails/rspec_rails/spec/rails_helper.rb | Ruby | mit | 4,885 | main | 1,310 | # This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../config/environment', __dir__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/rails/rspec_rails/config/puma.rb | Ruby | mit | 4,885 | main | 1,788 | # Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/rails/rspec_rails/config/application.rb | Ruby | mit | 4,885 | main | 1,139 | require_relative "boot"
require "logger"
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
# require "active_storage/engine"
require "action_controller/railtie"
# require "action_mailer/railtie"
# require "action_mailbox/engine"
... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/rails/rspec_rails/config/environments/development.rb | Ruby | mit | 4,885 | main | 2,220 | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for developme... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/rails/rspec_rails/config/environments/test.rb | Ruby | mit | 4,885 | main | 1,913 | require "active_support/core_ext/integer/time"
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data the... |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/subprocesses/lib/subprocesses.rb | Ruby | mit | 4,885 | main | 281 | class Subprocesses
def run
method_called_in_parent_process
pid = Process.fork do
method_called_by_subprocess
end
Process.wait(pid)
true
end
def method_called_in_parent_process
true
end
def method_called_by_subprocess
true
end
end |
github | simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov | test_projects/subprocesses/spec/spawn_spec.rb | Ruby | mit | 4,885 | main | 272 | require 'spec_helper'
require 'open3'
describe 'spawn' do
it 'calls things' do
Dir.chdir(File.expand_path('..', __dir__)) do
stdout, exitstatus = Open3.capture2("ruby -r./.simplecov_spawn lib/command")
expect(stdout.chomp).to eq 'done'
end
end
end |
github | backup/backup | https://github.com/backup/backup | Rakefile | Ruby | mit | 4,871 | master | 3,057 | require "rake/clean"
CLEAN.include("tmp")
CLOBBER.include("tmp")
Dir["integration/tasks/**/*.rake"].each { |f| import f }
require "rubocop/rake_task"
RuboCop::RakeTask.new
desc "Open a pry console in the Backup context"
task :console do
require "pry"
require "backup"
ARGV.clear
Pry.start || exit
end
def v... |
github | backup/backup | https://github.com/backup/backup | backup.gemspec | Ruby | mit | 4,871 | master | 2,279 | # encoding: utf-8
require File.expand_path("lib/backup/version")
Gem::Specification.new do |gem|
gem.name = "backup"
gem.version = Backup::VERSION
gem.authors = "Michael van Rooijen"
gem.email = "meskyanichi@gmail.com"
gem.homepage = "https://github.com/backup/backup"
gem.license ... |
github | backup/backup | https://github.com/backup/backup | spec/spec_helper.rb | Ruby | mit | 4,871 | master | 1,719 | require "rubygems" if RUBY_VERSION < "1.9"
require "bundler/setup"
require "backup"
require "timecop"
Dir[File.expand_path("../support/**/*.rb", __FILE__)].each { |f| require f }
module Backup
module ExampleHelpers
# ripped from MiniTest :)
# RSpec doesn't have a method for this? Am I missing something?
... |
github | backup/backup | https://github.com/backup/backup | spec/archive_spec.rb | Ruby | mit | 4,871 | master | 9,532 | require "spec_helper"
module Backup
describe Archive do
let(:model) { Model.new(:test_trigger, "test model") }
describe "#initialize" do
it "sets default values" do
archive = Archive.new(model, :test_archive) {}
expect(archive.name).to eq "test_archive"
expect(archive.options[... |
github | backup/backup | https://github.com/backup/backup | spec/pipeline_spec.rb | Ruby | mit | 4,871 | master | 10,358 | require "spec_helper"
describe "Backup::Pipeline" do
let(:pipeline) { Backup::Pipeline.new }
it "should include Utilities::Helpers" do
expect(Backup::Pipeline
.include?(Backup::Utilities::Helpers)).to eq(true)
end
describe "#initialize" do
it "should create a new pipeline" do
expect(pipel... |
github | backup/backup | https://github.com/backup/backup | spec/splitter_spec.rb | Ruby | mit | 4,871 | master | 3,697 | require "spec_helper"
module Backup
describe Splitter do
let(:model) { Model.new(:test_trigger, "test label") }
let(:package) { model.package }
let(:splitter) { Splitter.new(model, 250, 2) }
let(:splitter_long_suffix) { Splitter.new(model, 250, 3) }
let(:s) { sequence "" }
before do
al... |
github | backup/backup | https://github.com/backup/backup | spec/utilities_spec.rb | Ruby | mit | 4,871 | master | 14,296 | require "spec_helper"
describe Backup::Utilities do
let(:utilities) { Backup::Utilities }
let(:helpers) { Module.new.extend(Backup::Utilities::Helpers) }
# Note: spec_helper resets Utilities before each example
describe ".configure" do
before do
allow(File).to receive(:executable?).and_return(true)... |
github | backup/backup | https://github.com/backup/backup | spec/config_spec.rb | Ruby | mit | 4,871 | master | 11,940 | require "spec_helper"
module Backup
describe Config do
let(:config) { Config }
let(:major_gem_version) { Gem::Version.new(Backup::VERSION).segments.first }
# Note: spec_helper resets Config before each example
describe "#load" do
it "loads config.rb and models" do
allow(File).to recei... |
github | backup/backup | https://github.com/backup/backup | spec/package_spec.rb | Ruby | mit | 4,871 | master | 2,626 | require "spec_helper"
module Backup
describe Package do
let(:model) { Model.new(:test_trigger, "test label") }
let(:package) { Package.new(model) }
describe "#initialize" do
it "sets defaults" do
expect(package.time).to be_nil
expect(package.trigger).to eq "test_trigger"
... |
github | backup/backup | https://github.com/backup/backup | spec/errors_spec.rb | Ruby | mit | 4,871 | master | 15,267 | require "spec_helper"
module Backup
describe "Backup Errors" do
shared_examples "a nested exception" do
let(:class_name) { described_class.name.sub(/^Backup::/, "") }
context "with stubbed constants" do
before do
ErrorA = Class.new(described_class)
ErrorB = Class.new(desc... |
github | backup/backup | https://github.com/backup/backup | spec/packager_spec.rb | Ruby | mit | 4,871 | master | 7,960 | require "spec_helper"
describe "Backup::Packager" do
let(:packager) { Backup::Packager }
it "should include Utilities::Helpers" do
expect(packager.instance_eval("class << self; self; end")
.include?(Backup::Utilities::Helpers)).to eq(true)
end
describe "#package!" do
let(:model) { double }
... |
github | backup/backup | https://github.com/backup/backup | spec/cli_spec.rb | Ruby | mit | 4,871 | master | 23,671 | require "spec_helper"
require "rubygems/dependency_installer"
describe "Backup::CLI" do
let(:cli) { Backup::CLI }
let(:s) { sequence "" }
before { @argv_save = ARGV }
after { ARGV.replace(@argv_save) }
describe "#perform" do
let(:model_a) { Backup::Model.new(:test_trigger_a, "test label a"... |
github | backup/backup | https://github.com/backup/backup | spec/model_spec.rb | Ruby | mit | 4,871 | master | 31,750 | require "spec_helper"
describe "Backup::Model" do
let(:model) { Backup::Model.new(:test_trigger, "test label") }
let(:s) { sequence "" }
before { Backup::Model.send(:reset!) }
after { Backup::Model.send(:reset!) }
describe ".all" do
it "should be an empty array by default" do
expect(Backup::M... |
github | backup/backup | https://github.com/backup/backup | spec/cleaner_spec.rb | Ruby | mit | 4,871 | master | 10,572 | require "spec_helper"
module Backup
describe Cleaner do
let(:model) { Model.new(:test_trigger, "test label") }
describe "#prepare" do
let(:error_tail) do
<<-EOS.gsub(/^ +/, " ")
Please check the log for messages and/or your notifications
concerning this backup: 'test labe... |
github | backup/backup | https://github.com/backup/backup | spec/logger_spec.rb | Ruby | mit | 4,871 | master | 12,767 | require "spec_helper"
module Backup
describe Logger do
let(:console_logger) { double("Console Logger") }
let(:logfile_logger) { double("Logfile Logger") }
let(:syslog_logger) { double("Syslog Logger") }
let(:default_loggers) { [console_logger, logfile_logger] }
# Note: spec_helper calls Logger.... |
github | backup/backup | https://github.com/backup/backup | spec/support/sandbox_file_utils.rb | Ruby | mit | 4,871 | master | 7,518 | #
# Provides the ability to perform +FileUtils+ actions, while restricting
# any destructive actions outside of the specified +sandbox_path+.
#
# == Usage
#
# To enable protection:
#
# require 'sandbox_file_utils'
#
# SandboxFileUtils.activate!
# SandboxFileUtils.sandbox_path = 'my_sandbox'
# # or
# # Sandbox... |
github | backup/backup | https://github.com/backup/backup | spec/support/shared_examples/notifier.rb | Ruby | mit | 4,871 | master | 6,571 | shared_examples "a subclass of Notifier::Base" do
let(:notifier) { described_class.new(model) }
let(:notifier_name) { described_class.name.sub("Backup::", "") }
describe "#perform" do
context "when the model succeeded without warnings" do
before { allow(model).to receive(:exit_status).and_return(0) }
... |
github | backup/backup | https://github.com/backup/backup | spec/support/shared_examples/storage.rb | Ruby | mit | 4,871 | master | 7,052 | shared_examples "a subclass of Storage::Base" do
let(:storage_name) { described_class.name.sub("Backup::", "") }
describe "#initialize" do
it "sets a reference to the model" do
expect(storage.model).to be model
end
it "sets a reference to the package" do
expect(storage.package).to be model... |
github | backup/backup | https://github.com/backup/backup | spec/support/shared_examples/config_defaults.rb | Ruby | mit | 4,871 | master | 1,645 | shared_examples "a class that includes Config::Helpers" do
describe "setting defaults" do
let(:accessor_names) do
(described_class.instance_methods - Class.methods)
.select { |method| method.to_s.end_with?("=") }
.map { |name| name.to_s.chomp("=") }
end
before do
overrides = r... |
github | backup/backup | https://github.com/backup/backup | spec/support/shared_examples/database.rb | Ruby | mit | 4,871 | master | 3,275 | shared_examples "a subclass of Database::Base" do
describe "#initialize" do
it "sets a reference to the model" do
expect(db.model).to be(model)
end
it "cleans database_id for filename use" do
block = respond_to?(:required_config) ? required_config : proc {}
db = described_class.new(mod... |
github | backup/backup | https://github.com/backup/backup | spec/support/shared_examples/syncer/cloud.rb | Ruby | mit | 4,871 | master | 13,170 | shared_examples "a subclass of Syncer::Cloud::Base" do
let(:syncer_name) { described_class.name.sub("Backup::", "") }
let(:s) { sequence "" }
describe "#initialize" do
it "strips leading path separator" do
pre_config = required_config
klass = described_class.new do |syncer|
pre_config.cal... |
github | backup/backup | https://github.com/backup/backup | spec/database/postgresql_spec.rb | Ruby | mit | 4,871 | master | 11,638 | require "spec_helper"
module Backup
describe Database::PostgreSQL do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) { Database::PostgreSQL.new(model) }
let(:s) { sequence "" }
before do
allow(Utilities).to receive(:utility).with(:pg_dump).and_return("pg_dump")
allow(Util... |
github | backup/backup | https://github.com/backup/backup | spec/database/redis_spec.rb | Ruby | mit | 4,871 | master | 12,509 | require "spec_helper"
module Backup
describe Database::Redis do
let(:model) { Model.new(:test_trigger, "test label") }
let(:required_config) do
proc do |redis|
redis.rdb_path = "rdb_path_required_for_copy_mode"
end
end
let(:db) { Database::Redis.new(model, &required_config) }
... |
github | backup/backup | https://github.com/backup/backup | spec/database/openldap_spec.rb | Ruby | mit | 4,871 | master | 5,902 | require "spec_helper"
module Backup
describe Database::OpenLDAP do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) { Database::OpenLDAP.new(model) }
let(:s) { sequence "" }
before do
allow_any_instance_of(Database::OpenLDAP).to receive(:utility)
.with(:slapcat).and_retu... |
github | backup/backup | https://github.com/backup/backup | spec/database/mongodb_spec.rb | Ruby | mit | 4,871 | master | 13,441 | require "spec_helper"
module Backup
describe Database::MongoDB do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) { Database::MongoDB.new(model) }
before do
allow_any_instance_of(Database::MongoDB).to receive(:utility)
.with(:mongodump).and_return("mongodump")
allow_a... |
github | backup/backup | https://github.com/backup/backup | spec/database/riak_spec.rb | Ruby | mit | 4,871 | master | 4,274 | require "spec_helper"
module Backup
describe Database::Riak do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) { Database::Riak.new(model) }
let(:s) { sequence "" }
before do
allow_any_instance_of(Database::Riak).to receive(:utility)
.with("riak-admin").and_return("riak... |
github | backup/backup | https://github.com/backup/backup | spec/database/mysql_spec.rb | Ruby | mit | 4,871 | master | 15,827 | require "spec_helper"
module Backup
describe Database::MySQL do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) { Database::MySQL.new(model) }
let(:s) { sequence "" }
before do
allow_any_instance_of(Database::MySQL).to receive(:utility)
.with(:mysqldump).and_return("mys... |
github | backup/backup | https://github.com/backup/backup | spec/database/sqlite_spec.rb | Ruby | mit | 4,871 | master | 4,945 | require "spec_helper"
module Backup
describe Database::SQLite do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) do
Database::SQLite.new(model) do |db|
db.path = "/tmp/db1.sqlite3"
db.sqlitedump_utility = "/path/to/sqlitedump"
end
end
before do
allow... |
github | backup/backup | https://github.com/backup/backup | spec/encryptor/gpg_spec.rb | Ruby | mit | 4,871 | master | 34,510 | require "spec_helper"
describe Backup::Encryptor::GPG do
let(:encryptor) do
Backup::Encryptor::GPG.new do |e|
e.mode = :symmetric
e.passphrase = "test secret"
end
end
it "should be a subclass of Encryptor::Base" do
expect(Backup::Encryptor::GPG
.superclass).to eq(Backup::Encryptor:... |
github | backup/backup | https://github.com/backup/backup | spec/encryptor/open_ssl_spec.rb | Ruby | mit | 4,871 | master | 4,278 | require "spec_helper"
describe Backup::Encryptor::OpenSSL do
let(:encryptor) do
Backup::Encryptor::OpenSSL.new do |e|
e.password = "mypassword"
e.password_file = "/my/password/file"
e.base64 = true
end
end
it "should be a subclass of Encryptor::Base" do
expect(Backup::E... |
github | backup/backup | https://github.com/backup/backup | spec/encryptor/base_spec.rb | Ruby | mit | 4,871 | master | 1,022 | require "spec_helper"
describe Backup::Encryptor::Base do
let(:base) { Backup::Encryptor::Base.new }
it "should include Utilities::Helpers" do
expect(Backup::Encryptor::Base
.include?(Backup::Utilities::Helpers)).to eq(true)
end
it "should include Config::Helpers" do
expect(Backup::Encryptor::B... |
github | backup/backup | https://github.com/backup/backup | spec/compressor/custom_spec.rb | Ruby | mit | 4,871 | master | 3,666 | require "spec_helper"
describe Backup::Compressor::Custom do
let(:compressor) { Backup::Compressor::Custom.new }
before(:context) do
# Utilities::Helpers#utility will raise an error
# if the command is invalid or not set
Backup::Compressor::Custom.send(
:define_method, :utility,
->(arg) { ... |
github | backup/backup | https://github.com/backup/backup | spec/compressor/bzip2_spec.rb | Ruby | mit | 4,871 | master | 2,178 | require "spec_helper"
describe Backup::Compressor::Bzip2 do
before do
allow_any_instance_of(Backup::Compressor::Bzip2).to receive(:utility).and_return("bzip2")
end
it "should be a subclass of Compressor::Base" do
expect(Backup::Compressor::Bzip2
.superclass).to eq(Backup::Compressor::Base)
end
... |
github | backup/backup | https://github.com/backup/backup | spec/compressor/gzip_spec.rb | Ruby | mit | 4,871 | master | 4,312 | require "spec_helper"
describe Backup::Compressor::Gzip do
before do
allow(Backup::Compressor::Gzip).to receive(:utility).and_return("gzip")
Backup::Compressor::Gzip.instance_variable_set(:@has_rsyncable, true)
allow_any_instance_of(Backup::Compressor::Gzip).to receive(:utility).and_return("gzip")
end
... |
github | backup/backup | https://github.com/backup/backup | spec/compressor/base_spec.rb | Ruby | mit | 4,871 | master | 1,553 | require "spec_helper"
describe Backup::Compressor::Base do
let(:compressor) { Backup::Compressor::Base.new }
it "should include Utilities::Helpers" do
expect(Backup::Compressor::Base
.include?(Backup::Utilities::Helpers)).to eq(true)
end
it "should include Config::Helpers" do
expect(Backup::Com... |
github | backup/backup | https://github.com/backup/backup | spec/syncer/cloud/cloud_files_spec.rb | Ruby | mit | 4,871 | master | 5,351 | require "spec_helper"
module Backup
describe Syncer::Cloud::CloudFiles do
let(:required_config) do
proc do |cf|
cf.username = "my_username"
cf.api_key = "my_api_key"
cf.container = "my_container"
end
end
let(:syncer) { Syncer::Cloud::CloudFiles.new(&required_conf... |
github | backup/backup | https://github.com/backup/backup | spec/syncer/cloud/s3_spec.rb | Ruby | mit | 4,871 | master | 7,772 | require "spec_helper"
module Backup
describe Syncer::Cloud::S3 do
let(:required_config) do
proc do |s3|
s3.access_key_id = "my_access_key_id"
s3.secret_access_key = "my_secret_access_key"
s3.bucket = "my_bucket"
end
end
let(:required_iam_config) do
... |
github | backup/backup | https://github.com/backup/backup | spec/syncer/cloud/local_file_spec.rb | Ruby | mit | 4,871 | master | 2,732 | require "spec_helper"
module Backup
describe Syncer::Cloud::LocalFile do
describe ".find" do
before do
@tmpdir = Dir.mktmpdir("backup_spec")
SandboxFileUtils.activate!(@tmpdir)
FileUtils.mkdir_p File.join(@tmpdir, "sync_dir/sub_dir")
allow(Utilities).to receive(:utility).and... |
github | backup/backup | https://github.com/backup/backup | spec/syncer/rsync/pull_spec.rb | Ruby | mit | 4,871 | master | 4,139 | require "spec_helper"
module Backup
describe Syncer::RSync::Pull do
before do
allow_any_instance_of(Syncer::RSync::Pull).to \
receive(:utility).with(:rsync).and_return("rsync")
allow_any_instance_of(Syncer::RSync::Pull).to \
receive(:utility).with(:ssh).and_return("ssh")
end
... |
github | backup/backup | https://github.com/backup/backup | spec/syncer/rsync/push_spec.rb | Ruby | mit | 4,871 | master | 24,622 | require "spec_helper"
module Backup
describe Syncer::RSync::Push do
before do
allow_any_instance_of(Syncer::RSync::Push).to \
receive(:utility).with(:rsync).and_return("rsync")
allow_any_instance_of(Syncer::RSync::Push).to \
receive(:utility).with(:ssh).and_return("ssh")
end
... |
github | backup/backup | https://github.com/backup/backup | spec/syncer/rsync/local_spec.rb | Ruby | mit | 4,871 | master | 6,973 | require "spec_helper"
module Backup
describe Syncer::RSync::Local do
before do
allow_any_instance_of(Syncer::RSync::Local).to \
receive(:utility).with(:rsync).and_return("rsync")
end
describe "#initialize" do
after { Syncer::RSync::Local.clear_defaults! }
it "should use the va... |
github | backup/backup | https://github.com/backup/backup | spec/config/dsl_spec.rb | Ruby | mit | 4,871 | master | 3,287 | require "spec_helper"
module Backup
describe Config::DSL do
describe ".add_dsl_constants" do
it "adds constants when the module is loaded" do
described_class.constants.each do |const|
described_class.send(:remove_const, const)
end
expect(described_class.constants).to be_em... |
github | backup/backup | https://github.com/backup/backup | spec/config/helpers_spec.rb | Ruby | mit | 4,871 | master | 8,157 | require "spec_helper"
module Backup
describe "Config::Helpers" do
before do
class Foo
include Backup::Config::Helpers
attr_accessor :accessor, :accessor_two
attr_reader :reader
attr_deprecate :removed,
version: "1.1"
attr_deprecate :removed_with_message,
... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/zabbix_spec.rb | Ruby | mit | 4,871 | master | 4,618 | require "spec_helper"
module Backup
describe Notifier::Zabbix do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Zabbix.new(model) }
before do
allow(Utilities).to receive(:utility).with(:zabbix_sender).and_return("zabbix_sender")
allow(Config).to receive(:ho... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/nagios_spec.rb | Ruby | mit | 4,871 | master | 3,908 | require "spec_helper"
module Backup
describe Notifier::Nagios do
let(:model) { Model.new(:test_trigger, "test model") }
let(:notifier) { Notifier::Nagios.new(model) }
before do
allow(Utilities).to receive(:utility).with(:send_nsca).and_return("send_nsca")
allow(Config).to receive(:hostname).... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/pushover_spec.rb | Ruby | mit | 4,871 | master | 4,450 | require "spec_helper"
module Backup
describe Notifier::Pushover do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Pushover.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/http_post_spec.rb | Ruby | mit | 4,871 | master | 8,241 | require "spec_helper"
module Backup
describe Notifier::HttpPost do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) do
Notifier::HttpPost.new(model) do |post|
post.uri = "https://www.example.com/path"
end
end
let(:default_form_data) do
"message=%5BBackup... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/ses_spec.rb | Ruby | mit | 4,871 | master | 6,197 | require "spec_helper"
module Backup
describe Notifier::Ses do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Ses.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize" do
... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/command_notifier_spec.rb | Ruby | mit | 4,871 | master | 2,052 | require "spec_helper"
module Backup
describe Notifier::Command do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) do
Notifier::Command.new(model) do |cmd|
cmd.command = "notify-send"
cmd.args = [->(model, _) { model.label.upcase }, "%V | %t"]
end
end
... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/mail_spec.rb | Ruby | mit | 4,871 | master | 19,920 | require "spec_helper"
module Backup
describe Notifier::Mail do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Mail.new(model) }
before do
allow_any_instance_of(Notifier::Mail).to receive(:utility)
.with(:sendmail).and_return("/path/to/sendmail")
all... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/campfire_spec.rb | Ruby | mit | 4,871 | master | 3,584 | require "spec_helper"
module Backup
describe Notifier::Campfire do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Campfire.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/flowdock_spec.rb | Ruby | mit | 4,871 | master | 4,385 | require "spec_helper"
module Backup
describe Notifier::FlowDock do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::FlowDock.new(model) }
let(:s) { sequence "" }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/hipchat_spec.rb | Ruby | mit | 4,871 | master | 6,256 | require "spec_helper"
module Backup
describe Notifier::Hipchat do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Hipchat.new(model) }
let(:s) { sequence "" }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/twitter_spec.rb | Ruby | mit | 4,871 | master | 3,736 | require "spec_helper"
module Backup
describe Notifier::Twitter do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Twitter.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize" ... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/datadog_spec.rb | Ruby | mit | 4,871 | master | 4,497 | require "spec_helper"
module Backup
describe Notifier::DataDog do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::DataDog.new(model) }
let(:s) { sequence "" }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/slack_spec.rb | Ruby | mit | 4,871 | master | 4,884 | require "spec_helper"
module Backup
describe Notifier::Slack do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Slack.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize" do
... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/pagerduty_spec.rb | Ruby | mit | 4,871 | master | 2,502 | require "spec_helper"
module Backup
describe Notifier::PagerDuty do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::PagerDuty.new(model) }
describe "#initialize" do
it "has sensible defaults" do
expect(notifier.service_key).to be_nil
expect(notifie... |
github | backup/backup | https://github.com/backup/backup | spec/notifier/prowl_spec.rb | Ruby | mit | 4,871 | master | 3,074 | require "spec_helper"
module Backup
describe Notifier::Prowl do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Prowl.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize" do
... |
github | backup/backup | https://github.com/backup/backup | spec/logger/console_spec.rb | Ruby | mit | 4,871 | master | 4,342 | require "spec_helper"
module Backup
describe Logger::Console do
let(:timestamp) { Time.now.utc.strftime("%Y/%m/%d %H:%M:%S") }
before do
expect_any_instance_of(Logger::Logfile).to receive(:log).never
expect_any_instance_of(Logger::Syslog).to receive(:log).never
Logger.configure do
... |
github | backup/backup | https://github.com/backup/backup | spec/logger/logfile_spec.rb | Ruby | mit | 4,871 | master | 6,589 | require "spec_helper"
module Backup
describe Logger::Logfile do
before do
@tmpdir = Dir.mktmpdir("backup_spec")
SandboxFileUtils.activate!(@tmpdir)
@log_path_absolute = File.join(@tmpdir, "log_path")
@logfile_absolute = File.join(@log_path_absolute, "backup.log")
@root_path = File.... |
github | backup/backup | https://github.com/backup/backup | spec/logger/fog_adapter_spec.rb | Ruby | mit | 4,871 | master | 534 | require "spec_helper"
module Backup
describe Logger::FogAdapter do
it "replaces STDOUT fog warning channel" do
expect(Fog::Logger[:warning]).to be Logger::FogAdapter
end
describe "#tty?" do
it "returns false" do
expect(Logger::FogAdapter.tty?).to be(false)
end
end
desc... |
github | backup/backup | https://github.com/backup/backup | spec/logger/syslog_spec.rb | Ruby | mit | 4,871 | master | 2,890 | require "spec_helper"
module Backup
describe Logger::Syslog do
before do
expect_any_instance_of(Logger::Console).to receive(:log).never
expect_any_instance_of(Logger::Logfile).to receive(:log).never
Logger.configure do
console.quiet = true
logfile.enabled = false
syslog.... |
github | backup/backup | https://github.com/backup/backup | spec/cloud_io/cloud_files_spec.rb | Ruby | mit | 4,871 | master | 32,880 | require "spec_helper"
require "backup/cloud_io/cloud_files"
module Backup # rubocop:disable Metrics/ModuleLength
describe CloudIO::CloudFiles do
let(:connection) { double }
describe "#upload" do
before do
expect_any_instance_of(described_class).to receive(:create_containers)
end
c... |
github | backup/backup | https://github.com/backup/backup | spec/cloud_io/s3_spec.rb | Ruby | mit | 4,871 | master | 30,380 | require "spec_helper"
require "backup/cloud_io/s3"
module Backup
describe CloudIO::S3 do
let(:connection) { double }
describe "#upload" do
context "with multipart support" do
let(:cloud_io) { CloudIO::S3.new(bucket: "my_bucket", chunk_size: 5) }
let(:parts) { double }
context ... |
github | backup/backup | https://github.com/backup/backup | vagrant/Vagrantfile | Ruby | mit | 4,871 | master | 2,188 | # -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environmen... |
github | backup/backup | https://github.com/backup/backup | vagrant/utils/Rakefile | Ruby | mit | 4,871 | master | 349 | require 'bundler/setup'
Dir['tasks/**/*.rake'].each {|f| import f }
task :default => :tasklist
desc 'Show Rake Tasks (`rake -T`)'
task :tasklist do
exec 'rake -T'
end
desc 'Rebuild Everything'
task :all => [:archives, 'db:all']
namespace :db do
desc 'Rebuild All Databases'
task :all => [:mysql, :postgresql, ... |
github | backup/backup | https://github.com/backup/backup | vagrant/utils/Gemfile | Ruby | mit | 4,871 | master | 222 | source "https://rubygems.org"
gem 'rake'
# MySQL, PostgreSQL
gem 'activerecord'
gem 'activerecord-mysql2-adapter'
gem 'iconv'
gem 'pg'
# MongoDB
gem 'mongo'
gem 'bson_ext'
# Redis
gem 'redis'
# Riak
gem 'riak-client' |
github | backup/backup | https://github.com/backup/backup | vagrant/utils/tasks/mysql.rake | Ruby | mit | 4,871 | master | 1,978 | require 'active_record'
namespace :db do
desc 'Rebuild MySQL Test Databases'
task :mysql do
begin
puts "\n=> Preparing MySQL..."
MySQLTask.drop_all
MySQLTask.create_all
rescue Exception => err
errno = " (Error ##{ err.errno })" if err.respond_to?(:errno)
$stderr.puts "#{ err.c... |
github | backup/backup | https://github.com/backup/backup | vagrant/utils/tasks/postgresql.rake | Ruby | mit | 4,871 | master | 1,933 | require 'active_record'
namespace :db do
desc 'Rebuild PostgreSQL Test Databases'
task :postgresql do
begin
puts "\n=> Preparing PostgreSQL..."
PostgreSQLTask.drop_all
PostgreSQLTask.create_all
rescue Exception => err
$stderr.puts "#{ err.class }: #{ err.message }"
$stderr.put... |
github | backup/backup | https://github.com/backup/backup | vagrant/utils/tasks/riak.rake | Ruby | mit | 4,871 | master | 1,571 | require 'riak'
namespace :db do
desc 'Rebuild Riak Test Databases'
task :riak do
puts "\n=> Preparing Riak..."
RiakTask.recreate_node
begin
RiakTask.load_data
rescue Exception => err
$stderr.puts "#{ err.class }: #{ err.message }"
$stderr.puts err.backtrace
end
end
end
modu... |
github | backup/backup | https://github.com/backup/backup | vagrant/utils/tasks/mongodb.rake | Ruby | mit | 4,871 | master | 1,793 | require 'mongo'
namespace :db do
desc 'Rebuild MongoDB Test Databases'
task :mongodb do
puts "\n=> Preparing MongoDB..."
MongoDBTask.mongod_start
begin
MongoDBTask.drop_all
MongoDBTask.create_all
rescue Exception => err
$stderr.puts "#{ err.class }: #{ err.message }"
$stderr... |
github | backup/backup | https://github.com/backup/backup | vagrant/utils/tasks/redis.rake | Ruby | mit | 4,871 | master | 874 | require 'redis'
namespace :db do
desc 'Rebuild Redis Test Databases'
task :redis do
begin
puts "\n=> Preparing Redis..."
RedisTask.drop_all
RedisTask.create_all
rescue Exception => err
$stderr.puts "#{ err.class }: #{ err.message }"
$stderr.puts err.backtrace
end
end
end... |
github | backup/backup | https://github.com/backup/backup | vagrant/utils/tasks/archives.rake | Ruby | mit | 4,871 | master | 1,180 | require 'fileutils'
desc 'Rebuild Files/Folders for Archive Testing'
task :archives do
puts "\n=> Preparing Archive Testing..."
data_dir = '/home/vagrant/test_data'
root_data_dir = '/home/vagrant/test_root_data'
puts 'Cleaning Test Directories...'
FileUtils.rm_rf data_dir
%x[sudo rm -rf #{ root_data_dir }... |
github | backup/backup | https://github.com/backup/backup | vagrant/spec/spec_helper.rb | Ruby | mit | 4,871 | master | 1,614 | abort "These specs should only be run on the backup-testbox VM" unless
%x[hostname].chomp == 'backup-testbox'
version = '9'
found = File.read('/home/vagrant/backup-testbox-version').strip rescue '?'
warn(<<EOS) unless version == found
\n -- Warning: backup-testbox should be v.#{ version } - Found v.#{ found } --
... |
github | backup/backup | https://github.com/backup/backup | vagrant/spec/live/syncer/s3_spec.rb | Ruby | mit | 4,871 | master | 6,714 | require File.expand_path('../../../spec_helper', __FILE__)
# To run these tests, you need to setup your AWS S3 credentials in
# /vagrant/spec/live.yml
#
# It's recommended you use a dedicated Bucket for this, like:
# <aws_username>-backup-testing
#
# Note: The S3 Bucket you use should have read-after-write consist... |
github | backup/backup | https://github.com/backup/backup | vagrant/spec/live/syncer/cloud_files_spec.rb | Ruby | mit | 4,871 | master | 5,679 | require File.expand_path('../../../spec_helper', __FILE__)
# To run these tests, you need to setup your Cloudfiles credentials in
# /vagrant/spec/live.yml
#
# It's recommended you use a dedicated Container for this, like:
# backup.testing.container
#
# Note: Expectations will occasionally fail due to eventual cons... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.