1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

frozen literal magic comment

This commit is contained in:
Thomas Walpole 2016-03-07 16:52:19 -08:00
parent 62545535bb
commit 07e7777425
150 changed files with 172 additions and 23 deletions

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
When /^I visit the (?:root|home) page$/ do
visit('/')
end

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rubygems'
require 'bundler/setup'

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'timeout'
require 'nokogiri'
require 'xpath'

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'capybara/dsl'
require 'capybara/rspec/matchers'

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Capybara::Driver::Base
def current_url
raise NotImplementedError

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
module Driver
class Node

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'capybara'
module Capybara

View file

@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
module Capybara

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
module Node
module Actions

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
module Node

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
module Node

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
module Node
module DocumentMatchers

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
module Node

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
module Node
module Finders

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
module Node
module Matchers

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
module Node

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
# @api private
module Queries

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'addressable/uri'
module Capybara

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
# @api private
module Queries

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
# @api private
module Queries

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
# @deprecated This class and its methods are not supposed to be used by users of Capybara's public API.
# It may be removed in future versions of Capybara.

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Capybara::RackTest::Browser
include ::Rack::Test::Methods

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Capybara::RackTest::CSSHandlers < BasicObject
include ::Kernel

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rack/test'
require 'rack/utils'
require 'mime/types'

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Capybara::RackTest::Form < Capybara::RackTest::Node
# This only needs to inherit from Rack::Test::UploadedFile because Rack::Test checks for
# the class specifically when determining whether to construct the request as multipart.

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Capybara::RackTest::Node < Capybara::Driver::Node
def all_text
Capybara::Helpers.normalize_whitespace(native.text)

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'capybara/dsl'
Capybara.app = Rack::Builder.new do

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'forwardable'
module Capybara

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'capybara/dsl'
require 'rspec/core'
require 'capybara/rspec/matchers'

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
if RSpec::Core::Version::STRING.to_f >= 3.0
RSpec.shared_context "Capybara Features", :capybara_feature => true do
instance_eval do

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
module RSpecMatchers
class Matcher

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
class Selector
class Filter

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "uri"
class Capybara::Selenium::Driver < Capybara::Driver::Base

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Capybara::Selenium::Node < Capybara::Driver::Node
def visible_text
# Selenium doesn't normalize Unicode whitespace.

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'uri'
require 'net/http'
require 'rack'

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'capybara/session/matchers'
module Capybara

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Capybara
module SessionMatchers
##
@ -66,4 +67,4 @@ module Capybara
return false
end
end
end
end

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#accept_alert', :requires => [:modals] do
before do
@session.visit('/with_js')
@ -54,4 +55,4 @@ Capybara::SpecHelper.spec '#accept_alert', :requires => [:modals] do
expect(@session).to have_xpath("//a[@id='open-slow-alert' and @opened='true']")
end
end
end
end

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#accept_confirm', :requires => [:modals] do
before do
@session.visit('/with_js')
@ -27,4 +28,4 @@ Capybara::SpecHelper.spec '#accept_confirm', :requires => [:modals] do
}.not_to raise_error
expect(@session).to have_xpath("//a[@id='open-twice' and @confirmed='false']")
end
end
end

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#accept_prompt', :requires => [:modals] do
before do
@session.visit('/with_js')
@ -46,4 +47,4 @@ Capybara::SpecHelper.spec '#accept_prompt', :requires => [:modals] do
end
expect(message).to eq('Prompt opened')
end
end
end

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec "#all" do
before do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#assert_current_path' do
before do
@session.visit('/with_js')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#assert_selector' do
before do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#assert_text' do
it "should be true if the given text is on the page" do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#assert_title' do
before do
@session.visit('/with_js')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec "#attach_file" do
before do
@test_file_path = File.expand_path('../fixtures/test_file.txt', File.dirname(__FILE__))

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#body' do
it "should return the unmodified page body" do
@session.visit('/')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec "#check" do
before do
@session.visit('/form')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec "#choose" do
before do
@session.visit('/form')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#click_button' do
before do
@session.visit('/form')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#click_link_or_button' do
it "should click on a link" do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#click_link' do
before do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#current_scope' do
before do
@session.visit('/with_scope')
@ -26,4 +27,4 @@ Capybara::SpecHelper.spec '#current_scope' do
end
end
end
end
end

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require "capybara/spec/test_app"
Capybara::SpecHelper.spec '#current_url, #current_path, #current_host' do

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#dismiss_confirm', :requires => [:modals] do
before do
@session.visit('/with_js')
@ -32,4 +33,4 @@ Capybara::SpecHelper.spec '#dismiss_confirm', :requires => [:modals] do
end
expect(message).to eq('Confirm opened')
end
end
end

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#dismiss_prompt', :requires => [:modals] do
before do
@session.visit('/with_js')
@ -16,4 +17,4 @@ Capybara::SpecHelper.spec '#dismiss_prompt', :requires => [:modals] do
end
expect(message).to eq('Prompt opened')
end
end
end

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec "#evaluate_script", :requires => [:js] do
it "should evaluate the given script and return whatever it produces" do
@session.visit('/with_js')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec "#execute_script", :requires => [:js] do
it "should execute the given script and return nothing" do
@session.visit('/with_js')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec "#fill_in" do
before do
@session.visit('/form')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#find_button' do
before do
@session.visit('/form')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#find_by_id' do
before do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#find_field' do
before do
@session.visit('/form')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#find_link' do
before do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#find' do
before do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#first' do
before do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#go_back', :requires => [:js] do
it "should fetch a response from the driver from the previous page" do
@session.visit('/')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#go_forward', :requires => [:js] do
it "should fetch a response from the driver from the previous page" do
@session.visit('/')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_button?' do
before do
@session.visit('/form')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_css?' do
before do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_current_path?' do
before do
@session.visit('/with_js')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_field' do
before { @session.visit('/form') }

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_link?' do
before do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_select?' do
before { @session.visit('/form') }

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_selector?' do
before do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_table?' do
before do
@session.visit('/tables')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_text?' do
it "should be true if the given text is on the page at least once" do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_title?' do
before do
@session.visit('/with_js')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_xpath?' do
before do
@session.visit('/with_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#response_headers' do
it "should return response headers", :requires => [:response_headers] do
@session.visit('/with_simple_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#html' do
it "should return the unmodified page body" do
@session.visit('/')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec "node" do
before do

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#reset_session!' do
it "removes cookies" do
@session.visit('/set_cookie')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#status_code' do
it "should return response codes", :requires => [:status_code] do
@session.visit('/with_simple_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'launchy'
Capybara::SpecHelper.spec '#save_and_open_page' do

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'launchy'
Capybara::SpecHelper.spec '#save_and_open_screenshot' do

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#save_page' do
let(:alternative_path) { File.join(Dir.pwd, "save_and_open_page_tmp") }
before do

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#save_screenshot', requires: [:screenshot] do
before do
@session.visit '/foo'

View file

@ -1,4 +1,6 @@
#coding: US-ASCII
# coding: US-ASCII
# frozen_string_literal: true
Capybara::SpecHelper.spec "#save_screenshot" do
let(:image_path) { File.join(Dir.tmpdir, 'capybara-screenshot.png') }

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec "#select" do
before do
@session.visit('/form')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#text' do
it "should print the text of the page" do
@session.visit('/with_simple_html')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#title' do
it "should get the title of the page" do
@ -13,4 +14,4 @@ Capybara::SpecHelper.spec '#title' do
end
after { Capybara.default_selector = :xpath }
end
end
end

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec "#uncheck" do
before do
@session.visit('/form')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec "#unselect" do
before do
@session.visit('/form')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#visit' do
it "should fetch a response from the driver with a relative url" do
@session.visit('/')

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#become_closed', requires: [:windows, :js] do
before(:each) do
@window = @session.current_window

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#current_window', requires: [:windows] do
before(:each) do
@window = @session.current_window

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#open_new_window', requires: [:windows] do
before(:each) do
@window = @session.current_window

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#switch_to_window', requires: [:windows] do
before(:each) do
@window = @session.current_window

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec '#window_opened_by', requires: [:windows] do
before(:each) do
@window = @session.current_window

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
Capybara::SpecHelper.spec Capybara::Window, requires: [:windows] do
before(:each) do
@window = @session.current_window

Some files were not shown because too many files have changed in this diff Show more