-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d11610
commit bf94300
Showing
4 changed files
with
66 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require_relative 'spec_helper' | ||
|
||
describe 'rspec_helpers' do | ||
def toplevel_main | ||
@toplevel_main ||= eval('self', TOPLEVEL_BINDING) | ||
end | ||
|
||
it 'no_wait exists within rspec context' do | ||
toplevel_main.no_wait { true } | ||
|
||
no_wait do | ||
true | ||
end | ||
|
||
# no_wait raises an arg error when not passed a block | ||
expect_error(ArgumentError) { toplevel_main.no_wait } | ||
expect_error(ArgumentError) { no_wait } | ||
end | ||
|
||
it 'by exists within rspec' do | ||
expected = { css: 'ok' } | ||
|
||
expect_equal toplevel_main.by.css('ok'), expected | ||
expect_equal by.css('ok'), expected | ||
|
||
expect_error(ArgumentError) { toplevel_main.by.css } | ||
expect_error(ArgumentError) { by.css } | ||
end | ||
|
||
it 'element exists within rspec' do | ||
expected = AngularWebdriver::ProtractorElement | ||
|
||
expect_equal toplevel_main.element.class, expected | ||
expect_equal element.class, expected | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters