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 | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb | Ruby | mit | 11,598 | main | 1,305 | # frozen_string_literal: true
module Faker
class TvShows
class TheFreshPrinceOfBelAir < Base
flexible :the_fresh_prince_of_bel_air
class << self
##
# Produces a character from The Fresh Prince of Bel-Air.
#
# @return [String]
#
# @example
# F... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/stargate.rb | Ruby | mit | 11,598 | main | 1,100 | # frozen_string_literal: true
module Faker
class TvShows
class Stargate < Base
flexible :stargate
class << self
##
# Produces a character from Stargate.
#
# @return [String]
#
# @example
# Faker::TvShows::Stargate.character #=> "Jack O'Neill"... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/dumb_and_dumber.rb | Ruby | mit | 11,598 | main | 1,155 | # frozen_string_literal: true
module Faker
class TvShows
class DumbAndDumber < Base
flexible :dumb_and_dumber
class << self
##
# Produces an actor from Dumb and Dumber.
#
# @return [String]
#
# @example
# Faker::TvShows::DumbAndDumber.actor #... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/aqua_teen_hunger_force.rb | Ruby | mit | 11,598 | main | 891 | # frozen_string_literal: true
module Faker
class TvShows
class AquaTeenHungerForce < Base
flexible :aqua_teen_hunger_force
class << self
##
# Produces a character from Aqua Teen Hunger Force.
#
# @return [String]
#
# @example
# Faker::TvShows... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/friends.rb | Ruby | mit | 11,598 | main | 1,047 | # frozen_string_literal: true
module Faker
class TvShows
class Friends < Base
flexible :friends
class << self
##
# Produces a character from Friends.
#
# @return [String]
#
# @example
# Faker::TvShows::Friends.character #=> "Rachel Green"
... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/stranger_things.rb | Ruby | mit | 11,598 | main | 813 | # frozen_string_literal: true
module Faker
class TvShows
class StrangerThings < Base
flexible :stranger_things
class << self
##
# Produces a character from Stranger Things.
#
# @return [String]
#
# @example
# Faker::TvShows::StrangerThings.ch... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/big_bang_theory.rb | Ruby | mit | 11,598 | main | 830 | # frozen_string_literal: true
module Faker
class TvShows
class BigBangTheory < Base
flexible :big_bang_theory
class << self
##
# Produces a character from Big Bang Theory
#
# @return [String]
#
# @example
# Faker::TvShows::BigBangTheory.chara... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/final_space.rb | Ruby | mit | 11,598 | main | 1,148 | # frozen_string_literal: true
module Faker
class TvShows
class FinalSpace < Base
flexible :final_space
class << self
##
# Produces a character from Final Space.
#
# @return [String]
#
# @example
# Faker::TvShows::FinalSpace.character #=> "Gar... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/new_girl.rb | Ruby | mit | 11,598 | main | 814 | # frozen_string_literal: true
module Faker
class TvShows
class NewGirl < Base
flexible :new_girl
class << self
##
# Produces a character from New Girl.
#
# @return [String]
#
# @example
# Faker::TvShows::NewGirl.character #=> "Jessica Day"
... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/simpsons.rb | Ruby | mit | 11,598 | main | 1,508 | # frozen_string_literal: true
module Faker
class TvShows
class Simpsons < Base
flexible :simpsons
class << self
##
# Produces a character from The Simpsons.
#
# @return [String]
#
# @example
# Faker::TvShows::Simpsons.character #=> "Charles M... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/supernatural.rb | Ruby | mit | 11,598 | main | 1,078 | # frozen_string_literal: true
module Faker
class TvShows
class Supernatural < Base
class << self
##
# Produces the name of a character from Supernatural.
#
# @return [String]
#
# @example
# Faker::TvShows::Supernatural.character #=> "Dean Winchester... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/brooklyn_nine_nine.rb | Ruby | mit | 11,598 | main | 884 | # frozen_string_literal: true
module Faker
class TvShows
class BrooklynNineNine < Base
flexible :brooklyn_nine_nine
class << self
##
# Produces a character from Brooklyn Nine Nine.
#
# @return [String]
#
# @example
# Faker::TvShows::BrooklynN... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/bojack_horseman.rb | Ruby | mit | 11,598 | main | 1,284 | # frozen_string_literal: true
module Faker
class TvShows
class BojackHorseman < Base
flexible :bojack_horseman
class << self
##
# Produces a character from BoJack Horseman.
#
# @return [String]
#
# @example
# Faker::TvShows::BojackHorseman.ch... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/parks_and_rec.rb | Ruby | mit | 11,598 | main | 790 | # frozen_string_literal: true
module Faker
class TvShows
class ParksAndRec < Base
flexible :parks_and_rec
class << self
##
# Produces a character from Parks and Recreation.
#
# @return [String]
#
# @example
# Faker::TvShows::ParksAndRec.chara... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/michael_scott.rb | Ruby | mit | 11,598 | main | 463 | # frozen_string_literal: true
module Faker
class TvShows
class MichaelScott < Base
class << self
##
# Produces a quote from Michael Scott.
#
# @return [String]
#
# @example
# Faker::TvShows::MichaelScott.quote
# #=> "I am Beyoncé, always... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/spongebob.rb | Ruby | mit | 11,598 | main | 1,059 | # frozen_string_literal: true
module Faker
class TvShows
class Spongebob < Base
flexible :spongebob
class << self
##
# Produces a character from Spongebob.
#
# @return [String]
#
# @example
# Faker::TvShows::Spongebob.character #=> "Patrick"
... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/seinfeld.rb | Ruby | mit | 11,598 | main | 1,121 | # frozen_string_literal: true
module Faker
class TvShows
class Seinfeld < Base
flexible :seinfeld
class << self
##
# Produces a business from Seinfeld.
#
# @return [String]
#
# @example
# Faker::TvShows::Seinfeld.business #=> "Kruger Industri... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/the_expanse.rb | Ruby | mit | 11,598 | main | 1,362 | # frozen_string_literal: true
module Faker
class TvShows
class TheExpanse < Base
flexible :the_expanse
class << self
##
# Produces a character from The Expanse.
#
# @return [String]
#
# @example
# Faker::TvShows::TheExpanse.character #=> "Jim... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/the_it_crowd.rb | Ruby | mit | 11,598 | main | 1,447 | # frozen_string_literal: true
module Faker
class TvShows
class TheITCrowd < Base
flexible :the_it_crowd
class << self
##
# Produces an actor from The IT Crowd.
#
# @return [String]
#
# @example
# Faker::TvShows::TheITCrowd.actor #=> "Chris O'... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/twin_peaks.rb | Ruby | mit | 11,598 | main | 1,101 | # frozen_string_literal: true
module Faker
class TvShows
class TwinPeaks < Base
flexible :twin_peaks
class << self
##
# Produces a character from Twin Peaks.
#
# @return [String]
#
# @example
# Faker::TvShows::TwinPeaks.character #=> "Dale Co... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/archer.rb | Ruby | mit | 11,598 | main | 1,063 | # frozen_string_literal: true
module Faker
class TvShows
class Archer < Base
flexible :archer
class << self
##
# Produces a character from Archer.
#
# @return [String]
#
# @example
# Faker::TvShows::Archer.character #=> "Sterling Archer"
... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/ru_paul.rb | Ruby | mit | 11,598 | main | 764 | # frozen_string_literal: true
module Faker
class TvShows
class RuPaul < Base
flexible :rupaul
class << self
##
# Produces a quote from RuPaul's Drag Race.
#
# @return [String]
#
# @example
# Faker::TvShows::RuPaul.quote #=> "That's Funny, Tel... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/how_i_met_your_mother.rb | Ruby | mit | 11,598 | main | 1,588 | # frozen_string_literal: true
module Faker
class TvShows
class HowIMetYourMother < Base
flexible :how_i_met_your_mother
class << self
##
# Produces a character from How I Met Your Mother.
#
# @return [String]
#
# @example
# Faker::TvShows::Ho... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/rick_and_morty.rb | Ruby | mit | 11,598 | main | 1,146 | # frozen_string_literal: true
module Faker
class TvShows
class RickAndMorty < Base
flexible :rick_and_morty
class << self
##
# Produces a character from Rick and Morty.
#
# @return [String]
#
# @example
# Faker::TvShows::RickAndMorty.characte... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/family_guy.rb | Ruby | mit | 11,598 | main | 1,103 | # frozen_string_literal: true
module Faker
class TvShows
class FamilyGuy < Base
flexible :family_guy
class << self
##
# Produces a character from Family Guy.
#
# @return [String]
#
# @example
# Faker::TvShows::FamilyGuy.character #=> "Peter G... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/the_office.rb | Ruby | mit | 11,598 | main | 825 | # frozen_string_literal: true
module Faker
class TvShows
class TheOffice < Base
flexible :the_office
class << self
##
# Produces a character from The Office.
#
# @return [String]
#
# @example
# Faker::TvShows::TheOffice.character #=> "Michael... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/suits.rb | Ruby | mit | 11,598 | main | 752 | # frozen_string_literal: true
module Faker
class TvShows
class Suits < Base
flexible :suits
class << self
##
# Produces a character from Suits.
#
# @return [String]
#
# @example
# Faker::TvShows::Suits.character #=> "Harvey Specter"
#... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/buffy.rb | Ruby | mit | 11,598 | main | 1,700 | # frozen_string_literal: true
module Faker
class TvShows
class Buffy < Base
flexible :buffy
class << self
##
# Produces a character from Buffy the Vampire Slayer.
#
# @return [String]
#
# @example
# Faker::TvShows::Buffy.character #=> "Buffy ... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/hey_arnold.rb | Ruby | mit | 11,598 | main | 1,102 | # frozen_string_literal: true
module Faker
class TvShows
class HeyArnold < Base
flexible :hey_arnold
class << self
##
# Produces a character from Hey Arnold!
#
# @return [String]
#
# @example
# Faker::TvShows::HeyArnold.character #=> "Arnold"... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/tv_shows/futurama.rb | Ruby | mit | 11,598 | main | 1,466 | # frozen_string_literal: true
module Faker
class TvShows
class Futurama < Base
flexible :futurama
class << self
##
# Produces a character from Futurama.
#
# @return [String]
#
# @example
# Faker::TvShows::Futurama.character #=> "Amy Wong"
... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/travel/airport.rb | Ruby | mit | 11,598 | main | 1,432 | # frozen_string_literal: true
module Faker
class Travel
class Airport < Base
class << self
##
# Produces random Airport by name and takes arguments for size and region
#
# @param size [String] airport size, united_states has large, or medium, or small, european_union has lar... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/travel/train_station.rb | Ruby | mit | 11,598 | main | 1,852 | # frozen_string_literal: true
module Faker
class Travel
class TrainStation < Base
class << self
##
# Produces random Train Station by name and takes optional arguments for region and type
#
# @param region [String] Train station region: germany, spain, united_kingdom, united... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/japanese_media/kamen_rider.rb | Ruby | mit | 11,598 | main | 2,746 | # frozen_string_literal: true
module Faker
class JapaneseMedia
class KamenRider < Base
class << self
ERAS = %i[showa heisei reiwa].freeze
def eras=(new_eras)
selected_eras = ERAS & new_eras
@eras = selected_eras.empty? ? ERAS : selected_eras
end
##
... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/japanese_media/conan.rb | Ruby | mit | 11,598 | main | 1,039 | # frozen_string_literal: true
module Faker
class JapaneseMedia
class Conan < Base
class << self
##
# Produces a character from Conan.
#
# @return [String]
#
# @example
# Faker::JapaneseMedia::Conan.character #=> "Conan Edogawa"
#
# @... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/japanese_media/doraemon.rb | Ruby | mit | 11,598 | main | 1,038 | # frozen_string_literal: true
module Faker
class JapaneseMedia
class Doraemon < Base
class << self
##
# Produces a character from Doraemon.
#
# @return [String]
#
# @example
# Faker::JapaneseMedia::Doraemon.character #=> "Nobita"
#
#... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/japanese_media/naruto.rb | Ruby | mit | 11,598 | main | 1,336 | # frozen_string_literal: true
module Faker
class JapaneseMedia
class Naruto < Base
class << self
##
# Produces a character from Naruto.
#
# @return [String]
#
# @example
# Faker::JapaneseMedia::Naruto.character #=> "Naruto Uzumaki"
#
... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/japanese_media/studio_ghibli.rb | Ruby | mit | 11,598 | main | 1,143 | # frozen_string_literal: true
module Faker
class JapaneseMedia
class StudioGhibli < Base
class << self
##
# Produces a character from the Studio Ghibli.
#
# @return [String]
#
# @example
# Faker::JapaneseMedia::StudioGhibli.character #=> "Chihiro"
... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/japanese_media/cowboy_bebop.rb | Ruby | mit | 11,598 | main | 1,385 | # frozen_string_literal: true
module Faker
class JapaneseMedia
class CowboyBebop < Base
class << self
##
# Produces a character from Cowboy Bebop.
#
# @return [String]
#
# @example
# Faker::JapaneseMedia::CowboyBebop.character #=> "Spike Spiegel"
... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb | Ruby | mit | 11,598 | main | 1,250 | # frozen_string_literal: true
module Faker
class JapaneseMedia
class FullmetalAlchemistBrotherhood < Base
class << self
##
# Produces a character from FullmetalAlchemistBrotherhood.
#
# @return [String]
#
# @example
# Faker::JapaneseMedia::Fullmetal... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/japanese_media/sword_art_online.rb | Ruby | mit | 11,598 | main | 1,505 | # frozen_string_literal: true
module Faker
class JapaneseMedia
class SwordArtOnline < Base
class << self
##
# Produces the real name of a character from Sword Art Online.
#
# @return [String]
#
# @example
# Faker::JapaneseMedia::SwordArtOnline.real_... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/japanese_media/dragon_ball.rb | Ruby | mit | 11,598 | main | 1,052 | # frozen_string_literal: true
module Faker
class JapaneseMedia
class DragonBall < Base
class << self
##
# Produces the name of a character from Dragon Ball.
#
# @return [String]
#
# @example
# Faker::Games::DragonBall.character #=> "Goku"
#
... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | lib/faker/japanese_media/one_piece.rb | Ruby | mit | 11,598 | main | 1,969 | # frozen_string_literal: true
module Faker
class JapaneseMedia
class OnePiece < Base
class << self
##
# Produces a character from One Piece.
#
# @return [String]
#
# @example
# Faker::JapaneseMedia::OnePiece.character #=> "Monkey D. Luffy"
#... |
github | faker-ruby/faker | https://github.com/faker-ruby/faker | benchmark/generators.rb | Ruby | mit | 11,598 | main | 812 | # frozen_string_literal: true
require 'benchmark/ips'
require 'faker'
def generators
constants.flat_map do |klass|
subclass_methods(klass)
end
end
def constants
Faker.constants.delete_if do |subclass|
%i[
Base
Cat
Char
Base58
Config
Date
Deprecator
Dog
... |
github | greatghoul/remote-working | https://github.com/greatghoul/remote-working | scripts/contributors.rb | Ruby | mit | 11,564 | master | 931 | #!/usr/bin/env ruby
require 'net/http'
require 'openssl'
require 'json'
API_HOST = 'api.github.com'.freeze
API_URL = '/repos/greatghoul/remote-working/stats/contributors'.freeze
http = Net::HTTP.new(API_HOST, 443)
http.use_ssl = true
response = http.send_request(
'GET', API_URL, nil,
Accept: 'application/vnd.git... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | Rakefile | Ruby | mit | 10,156 | master | 2,801 | # frozen_string_literal: true
require 'rubygems'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
require 'yard'
require 'rubocop/rake_task'
RuboCop::RakeTask.new
desc 'Run all examples with Firefox'
rspec_opts = '--color'
RSpec::Core::RakeTask.new(:spec_firefox) do |t|
t.rspec_opts = rspec_opts
t.p... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | capybara.gemspec | Ruby | mit | 10,156 | master | 3,181 | # frozen_string_literal: true
lib = File.expand_path('lib', __dir__)
$:.unshift lib unless $:.include?(lib)
require 'capybara/version'
Gem::Specification.new do |s|
s.name = 'capybara'
s.version = Capybara::VERSION
s.required_ruby_version = '>= 3.2.0'
s.license = 'MIT'
s.authors = ['Thomas Walpole', 'Jona... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | Gemfile | Ruby | mit | 10,156 | master | 234 | # frozen_string_literal: true
source 'https://rubygems.org'
gem 'bundler', '< 3.0'
gemspec
gem 'xpath', github: 'teamcapybara/xpath'
# gem 'rack-test', github: 'rack/rack-test'
group :doc do
gem 'redcarpet', platforms: :mri
end |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/dsl_spec.rb | Ruby | mit | 10,156 | master | 9,816 | # frozen_string_literal: true
require 'spec_helper'
require 'capybara/dsl'
class TestClass
include Capybara::DSL
end
Capybara::SpecHelper.run_specs TestClass.new, 'DSL', capybara_skip: %i[
js modals screenshot frames windows send_keys server hover about_scheme psc download css driver scroll spatial html_validati... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/server_spec.rb | Ruby | mit | 10,156 | master | 10,055 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Capybara::Server do
it 'should spool up a rack server' do
app = proc { |_env| [200, {}, ['Hello Server!']] }
server = described_class.new(app).boot
res = Net::HTTP.start(server.host, server.port) { |http| http.get('/') }
expect(res... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/selenium_spec_firefox_remote.rb | Ruby | mit | 10,156 | master | 4,782 | # frozen_string_literal: true
require 'spec_helper'
require 'selenium-webdriver'
require 'shared_selenium_session'
require 'shared_selenium_node'
require 'rspec/shared_spec_matchers'
def selenium_host
ENV.fetch('SELENIUM_HOST', '0.0.0.0')
end
def selenium_port
ENV.fetch('SELENIUM_PORT', 4445)
end
def ensure_sel... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/rspec_matchers_spec.rb | Ruby | mit | 10,156 | master | 3,163 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Capybara RSpec Matchers', type: :feature do
context 'after called on session' do
it 'HaveSelector should allow getting a description of the matcher' do
visit('/with_html')
matcher = have_selector(:css, 'h2.head', minimum: 3)
e... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/sauce_spec_chrome.rb | Ruby | mit | 10,156 | master | 1,347 | # frozen_string_literal: true
require 'spec_helper'
require 'selenium-webdriver'
require 'sauce_whisk'
# require 'shared_selenium_session'
# require 'shared_selenium_node'
# require 'rspec/shared_spec_matchers'
Capybara.register_driver :sauce_chrome do |app|
options = {
selenium_version: '4.8.0',
platform:... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/css_splitter_spec.rb | Ruby | mit | 10,156 | master | 1,083 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Capybara::Selector::CSS::Splitter do
let :splitter do
described_class.new
end
context 'split not needed' do
it 'normal CSS selector' do
css = 'div[id="abc"]'
expect(splitter.split(css)).to eq [css]
end
it 'comma in ... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/regexp_dissassembler_spec.rb | Ruby | mit | 10,156 | master | 6,762 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Capybara::Selector::RegexpDisassembler, :aggregate_failures do
it 'handles strings' do
verify_strings(
/abcdef/ => %w[abcdef],
/abc def/ => ['abc def']
)
end
it 'handles escaped characters' do
verify_strings(
/abc\... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/css_builder_spec.rb | Ruby | mit | 10,156 | master | 3,701 | # frozen_string_literal: true
require 'spec_helper'
# rubocop:disable RSpec/InstanceVariable
RSpec.describe Capybara::Selector::CSSBuilder do
let :builder do
described_class.new(@css)
end
context 'add_attribute_conditions' do
it 'adds a single string condition to a single selector' do
@css = 'div... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/whitespace_normalizer_spec.rb | Ruby | mit | 10,156 | master | 1,468 | # frozen_string_literal: true
require 'spec_helper'
require 'capybara/node/whitespace_normalizer'
RSpec.describe Capybara::Node::WhitespaceNormalizer do
subject(:normalizer) do
klass = Class.new do
include Capybara::Node::WhitespaceNormalizer
end
klass.new
end
let(:text_needing_correction) d... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/result_spec.rb | Ruby | mit | 10,156 | master | 6,131 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Capybara::Result do
let :string do
Capybara.string <<-STRING
<ul>
<li>Alpha</li>
<li>Beta</li>
<li>Gamma</li>
<li>Delta</li>
</ul>
STRING
end
let :result do
string.all '//li', minimum: 0 #... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/counter_spec.rb | Ruby | mit | 10,156 | master | 744 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Capybara::Server::Middleware::Counter do
let(:counter) { described_class.new }
let(:uri) { '/example' }
describe '#increment' do
it 'successfully' do
counter.increment(uri)
expect(counter).to be_positive
end
end
describ... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/selenium_spec_chrome.rb | Ruby | mit | 10,156 | master | 7,947 | # frozen_string_literal: true
require 'spec_helper'
require 'selenium-webdriver'
require 'shared_selenium_session'
require 'shared_selenium_node'
require 'rspec/shared_spec_matchers'
CHROME_DRIVER = :selenium_chrome
Selenium::WebDriver::Chrome.path = '/usr/bin/google-chrome-beta' if ENV.fetch('CI', nil) && ENV.fetch... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/xpath_builder_spec.rb | Ruby | mit | 10,156 | master | 4,111 | # frozen_string_literal: true
require 'spec_helper'
# rubocop:disable RSpec/InstanceVariable
RSpec.describe Capybara::Selector::XPathBuilder do
let :builder do
described_class.new(@xpath)
end
context 'add_attribute_conditions' do
it 'adds a single string condition to a single selector' do
@xpath ... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/shared_selenium_node.rb | Ruby | mit | 10,156 | master | 2,476 | # frozen_string_literal: true
require 'spec_helper'
require 'selenium-webdriver'
RSpec.shared_examples 'Capybara::Node' do |session, _mode|
let(:session) { session }
describe '#content_editable?' do
it 'returns true when the element is content editable' do
session.visit('/with_js')
expect(session... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/selenium_spec_firefox.rb | Ruby | mit | 10,156 | master | 11,259 | # frozen_string_literal: true
require 'spec_helper'
require 'selenium-webdriver'
require 'shared_selenium_session'
require 'shared_selenium_node'
require 'rspec/shared_spec_matchers'
Selenium::WebDriver.logger.ignore(:selenium_manager)
browser_options = Selenium::WebDriver::Firefox::Options.new
browser_options.add_a... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/selenium_spec_edge.rb | Ruby | mit | 10,156 | master | 2,133 | # frozen_string_literal: true
require 'spec_helper'
require 'selenium-webdriver'
require 'shared_selenium_session'
require 'shared_selenium_node'
require 'rspec/shared_spec_matchers'
# unless ENV['CI']
# Selenium::WebDriver::Edge::Service.driver_path = '/usr/local/bin/msedgedriver'
# end
Selenium::WebDriver.logger... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/selenium_spec_safari.rb | Ruby | mit | 10,156 | master | 7,548 | # frozen_string_literal: true
require 'spec_helper'
require 'selenium-webdriver'
require 'shared_selenium_session'
require 'shared_selenium_node'
require 'rspec/shared_spec_matchers'
SAFARI_DRIVER = :selenium_safari
# if ::Selenium::WebDriver::Service.respond_to? :driver_path=
# ::Selenium::WebDriver::Safari::Serv... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/selector_spec.rb | Ruby | mit | 10,156 | master | 22,140 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Capybara do
include Capybara::RSpecMatchers
describe 'Selectors' do
let :string do
described_class.string <<-STRING
<html>
<head>
<title>selectors</title>
</head>
<body>
<div... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/basic_node_spec.rb | Ruby | mit | 10,156 | master | 5,659 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Capybara do
include Capybara::RSpecMatchers
describe '.string' do
let :string do
described_class.string <<-STRING
<html>
<head>
<title>simple_node</title>
</head>
<body>
<svg... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/filter_set_spec.rb | Ruby | mit | 10,156 | master | 1,424 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Capybara::Selector::FilterSet do
after do
described_class.remove(:test)
end
it 'allows node filters' do
fs = described_class.add(:test) do
node_filter(:node_test, :boolean) { |_node, _value| true }
expression_filter(:express... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/selenium_spec_chrome_remote.rb | Ruby | mit | 10,156 | master | 2,863 | # frozen_string_literal: true
require 'spec_helper'
require 'selenium-webdriver'
require 'shared_selenium_session'
require 'shared_selenium_node'
require 'rspec/shared_spec_matchers'
def selenium_host
ENV.fetch('SELENIUM_HOST', '0.0.0.0')
end
def selenium_port
ENV.fetch('SELENIUM_PORT', 4444)
end
def ensure_sel... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/minitest_spec_spec.rb | Ruby | mit | 10,156 | master | 5,182 | # frozen_string_literal: true
require 'spec_helper'
require 'capybara/minitest'
require 'capybara/minitest/spec'
class MinitestSpecTest < Minitest::Spec
include ::Capybara::DSL
include ::Capybara::Minitest::Assertions
before do
visit('/form')
end
after do
Capybara.reset_sessions!
end
def self... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/session_spec.rb | Ruby | mit | 10,156 | master | 2,439 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Capybara::Session do
describe '#new' do
it 'should raise an error if passed non-existent driver' do
expect do
described_class.new(:quox, TestApp).driver
end.to raise_error(Capybara::DriverNotFoundError)
end
it 'verif... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/shared_selenium_session.rb | Ruby | mit | 10,156 | master | 24,012 | # frozen_string_literal: true
require 'spec_helper'
require 'selenium-webdriver'
RSpec.shared_examples 'Capybara::Session' do |session, mode|
let(:session) { session }
context 'with selenium driver' do
describe '#driver' do
it 'should be a selenium driver' do
expect(session.driver).to be_an_ins... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/capybara_spec.rb | Ruby | mit | 10,156 | master | 3,762 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Capybara do
describe 'default_max_wait_time' do
before { @previous_default_time = described_class.default_max_wait_time }
after { described_class.default_max_wait_time = @previous_default_time } # rubocop:disable RSpec/InstanceVariable
... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/per_session_config_spec.rb | Ruby | mit | 10,156 | master | 2,750 | # frozen_string_literal: true
require 'spec_helper'
require 'capybara/dsl'
RSpec.describe Capybara::SessionConfig do
describe 'threadsafe' do
it 'defaults to global session options' do
Capybara.threadsafe = true
session = Capybara::Session.new(:rack_test, TestApp)
%i[default_host app_host alwa... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/rspec_spec.rb | Ruby | mit | 10,156 | master | 4,687 | # frozen_string_literal: true
# rubocop:disable RSpec/MultipleDescribes
require 'spec_helper'
RSpec.describe 'capybara/rspec' do
context 'Feature', type: :feature do
it 'should include Capybara in rspec' do
visit('/foo')
expect(page.body).to include('Another World')
end
it 'should include ... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/minitest_spec.rb | Ruby | mit | 10,156 | master | 4,826 | # frozen_string_literal: true
require 'spec_helper'
require 'capybara/minitest'
class MinitestTest < Minitest::Test
include Capybara::DSL
include Capybara::Minitest::Assertions
def setup
visit('/form')
end
def teardown
Capybara.reset_sessions!
end
def self.test_order
:sorted
end
def ... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/selenium_spec_ie.rb | Ruby | mit | 10,156 | master | 6,397 | # frozen_string_literal: true
require 'spec_helper'
require 'selenium-webdriver'
require 'shared_selenium_session'
require 'shared_selenium_node'
require 'rspec/shared_spec_matchers'
# if ENV['CI']
# if ::Selenium::WebDriver::Service.respond_to? :driver_path=
# ::Selenium::WebDriver::IE::Service
# else
# ... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/rack_test_spec.rb | Ruby | mit | 10,156 | master | 10,183 | # frozen_string_literal: true
require 'spec_helper'
module TestSessions
RackTest = Capybara::Session.new(:rack_test, TestApp)
end
skipped_tests = %i[
js
modals
screenshot
frames
windows
send_keys
server
hover
about_scheme
download
css
scroll
spatial
html_validation
shadow_dom
active... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/spec_helper.rb | Ruby | mit | 10,156 | master | 3,954 | # frozen_string_literal: true
require 'rspec/expectations'
require 'selenium_statistics'
if ENV['TRAVIS']
require 'coveralls'
Coveralls.wear! do
add_filter '/lib/capybara/driver/'
add_filter '/lib/capybara/registrations/'
end
end
require 'capybara/spec/spec_helper'
module Capybara
module SpecHelper
... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/rspec/views_spec.rb | Ruby | mit | 10,156 | master | 383 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'capybara/rspec', type: :view do
it 'allows matchers to be used on strings' do
html = %(<h1>Test header</h1>)
expect(html).to have_css('h1', text: 'Test header')
end
it "doesn't include RSpecMatcherProxies" do
expect(self.class.ance... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/rspec/shared_spec_matchers.rb | Ruby | mit | 10,156 | master | 34,120 | # frozen_string_literal: true
require 'spec_helper'
require 'capybara/dsl'
require 'capybara/rspec/matchers'
require 'benchmark'
# rubocop:disable RSpec/ExpectActual
RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode|
include Capybara::DSL
include Capybara::RSpecMatchers
describe 'have_css match... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/rspec/scenarios_spec.rb | Ruby | mit | 10,156 | master | 663 | # frozen_string_literal: true
# rubocop:disable RSpec/MultipleDescribes
require 'spec_helper'
require 'capybara/rspec'
RSpec.configuration.before(:each, file_path: './spec/rspec/scenarios_spec.rb') do
@in_filtered_hook = true
end
feature 'if fscenario aliases focused tag then' do
fscenario 'scenario should have... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | spec/rspec/features_spec.rb | Ruby | mit | 10,156 | master | 2,652 | # frozen_string_literal: true
# rubocop:disable RSpec/MultipleDescribes
require 'spec_helper'
require 'capybara/rspec'
# rubocop:disable RSpec/InstanceVariable
RSpec.configuration.before(:each, file_path: './spec/rspec/features_spec.rb') do
@in_filtered_hook = true
end
feature "Capybara's feature DSL" do
backgr... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | features/step_definitions/capybara_steps.rb | Ruby | mit | 10,156 | master | 622 | # frozen_string_literal: true
When(/^I visit the (?:root|home) page$/) do
visit('/')
end
Then(/^I should see "([^"]*)"$/) do |text|
expect(page).to have_content(text)
end
Then(/^Capybara should use the "([^"]*)" driver$/) do |driver|
expect(Capybara.current_driver).to eq(driver.to_sym)
end
When(/^I use a matc... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | features/support/env.rb | Ruby | mit | 10,156 | master | 516 | # frozen_string_literal: true
require 'rubygems'
require 'bundler/setup'
require 'capybara/cucumber'
require 'capybara/spec/test_app'
Capybara.app = TestApp
# These drivers are only used for testing driver switching.
# They don't actually need to process javascript so use RackTest
Capybara.register_driver :javascr... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara.rb | Ruby | mit | 10,156 | master | 19,464 | # frozen_string_literal: true
require 'timeout'
require 'nokogiri'
require 'xpath'
require 'forwardable'
require 'capybara/config'
require 'capybara/registration_container'
module Capybara
class CapybaraError < StandardError; end
class DriverNotFoundError < CapybaraError; end
class FrozenInTime < CapybaraError;... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/config.rb | Ruby | mit | 10,156 | master | 2,928 | # frozen_string_literal: true
require 'forwardable'
require 'capybara/session/config'
module Capybara
class Config
extend Forwardable
OPTIONS = %i[
app reuse_server threadsafe server default_driver javascript_driver use_html5_parsing allow_gumbo
].freeze
attr_accessor :app, :use_html5_parsin... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/rspec.rb | Ruby | mit | 10,156 | master | 1,017 | # frozen_string_literal: true
require 'rspec/core'
require 'capybara/dsl'
require 'capybara/rspec/matchers'
require 'capybara/rspec/features'
require 'capybara/rspec/matcher_proxies'
RSpec.configure do |config|
config.include Capybara::DSL, type: :feature
config.include Capybara::RSpecMatchers, type: :feature
c... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/minitest.rb | Ruby | mit | 10,156 | master | 12,692 | # frozen_string_literal: true
require 'minitest'
require 'capybara/dsl'
module Capybara
module Minitest
module Assertions
##
# Assert text exists
#
# @!method assert_content
# @!method assert_text
# See {Capybara::Node::Matchers#assert_text}
##
# Assert text do... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/session.rb | Ruby | mit | 10,156 | master | 33,174 | # frozen_string_literal: true
require 'capybara/session/matchers'
require 'addressable/uri'
module Capybara
##
#
# The {Session} class represents a single user's interaction with the system. The {Session} can use
# any of the underlying drivers. A session can be initialized manually like this:
#
# ses... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/selector.rb | Ruby | mit | 10,156 | master | 21,334 | # frozen_string_literal: true
require 'capybara/selector/xpath_extensions'
require 'capybara/selector/selector'
require 'capybara/selector/definition'
#
# All Selectors below support the listed selector specific filters in addition to the following system-wide filters
# * :id (String, Regexp, XPath::Expression) - M... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/result.rb | Ruby | mit | 10,156 | master | 4,748 | # frozen_string_literal: true
require 'forwardable'
module Capybara
##
# A {Capybara::Result} represents a collection of {Capybara::Node::Element} on the page. It is possible to interact with this
# collection similar to an Array because it implements Enumerable and offers the following Array methods through de... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/registration_container.rb | Ruby | mit | 10,156 | master | 976 | # frozen_string_literal: true
module Capybara
# @api private
class RegistrationContainer
def names
@registered.keys
end
def [](name)
@registered[name]
end
def []=(name, value)
Capybara::Helpers.warn 'DEPRECATED: Directly setting drivers/servers is deprecated, please use Capy... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/rails.rb | Ruby | mit | 10,156 | master | 387 | # frozen_string_literal: true
require 'capybara/dsl'
Capybara.app = Rack::Builder.new do
map '/' do
run Rails.application
end
end.to_app
Capybara.save_path = Rails.root.join('tmp/capybara')
# Override default rack_test driver to respect data-method attributes.
Capybara.register_driver :rack_test do |app|
... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/dsl.rb | Ruby | mit | 10,156 | master | 1,301 | # frozen_string_literal: true
require 'capybara'
module Capybara
module DSL
def self.included(base)
warn 'including Capybara::DSL in the global scope is not recommended!' if base == Object
super
end
def self.extended(base)
warn 'extending the main object with Capybara::DSL is not reco... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/window.rb | Ruby | mit | 10,156 | master | 3,978 | # frozen_string_literal: true
module Capybara
##
# The {Window} class represents a browser window.
#
# You can get an instance of the class by calling any of:
#
# * {Capybara::Session#windows}
# * {Capybara::Session#current_window}
# * {Capybara::Session#window_opened_by}
# * {Capybara::Session#switc... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/cucumber.rb | Ruby | mit | 10,156 | master | 544 | # frozen_string_literal: true
require 'capybara/dsl'
require 'capybara/rspec/matchers'
require 'capybara/rspec/matcher_proxies'
World(Capybara::DSL)
World(Capybara::RSpecMatchers)
After do
Capybara.reset_sessions!
end
Before do
Capybara.use_default_driver
end
Before '@javascript' do
Capybara.current_driver =... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/server.rb | Ruby | mit | 10,156 | master | 3,268 | # frozen_string_literal: true
require 'uri'
require 'net/http'
require 'rack'
require 'capybara/server/middleware'
require 'capybara/server/animation_disabler'
require 'capybara/server/checker'
module Capybara
# @api private
class Server
class << self
def ports
@ports ||= {}
end
end
... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/helpers.rb | Ruby | mit | 10,156 | master | 3,969 | # frozen_string_literal: true
module Capybara
# @api private
module Helpers
module_function
##
# @deprecated
# Normalizes whitespace space by stripping leading and trailing
# whitespace and replacing sequences of whitespace characters
# with a single space.
#
# @param [String] text ... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/driver/base.rb | Ruby | mit | 10,156 | master | 4,880 | # frozen_string_literal: true
class Capybara::Driver::Base
attr_writer :session
def current_url
raise NotImplementedError
end
def visit(path)
raise NotImplementedError
end
def refresh
raise NotImplementedError
end
def find_xpath(query, **options)
raise NotImplementedError
end
d... |
github | teamcapybara/capybara | https://github.com/teamcapybara/capybara | lib/capybara/driver/node.rb | Ruby | mit | 10,156 | master | 2,943 | # frozen_string_literal: true
module Capybara
module Driver
class Node
attr_reader :driver, :native, :initial_cache
def initialize(driver, native, initial_cache = {})
@driver = driver
@native = native
@initial_cache = initial_cache
end
def all_text
raise ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.