Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

starting to add the nessecary files for cukes

  • Loading branch information...
commit 49cd7f1ed82e3154a54581acadc6a2645d926f45 1 parent 00b5602
@cheezy authored
View
9 Rakefile
@@ -1,8 +1,11 @@
require 'rubygems'
require 'bundler'
+require 'rspec/core/rake_task'
+require 'cucumber'
+require 'cucumber/rake/task'
+
Bundler::GemHelper.install_tasks
-require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.ruby_opts = "-I lib:spec"
spec.pattern = 'spec/**/*_spec.rb'
@@ -10,6 +13,10 @@ end
task :spec
+Cucumber::Rake::Task.new(:features) do |t|
+ t.cucumber_opts = "features --format pretty"
+end
+
task :lib do
$LOAD_PATH.unshift(File.expand_path("lib", File.dirname(__FILE__)))
end
View
4 cucumber.yml
@@ -0,0 +1,4 @@
+default: --no-source
+watir: --no-source --tags @watir
+selenium: --no-source --tags @selenium
+
View
4 features/support/env.rb
@@ -0,0 +1,4 @@
+require 'rspec/expectations'
+
+
+
View
19 spec/page-object/page-object_spec.rb
@@ -34,14 +34,9 @@ class TestPageObject
describe "page level functionality" do
context "when using WatirPageObject" do
- def mock_watir_browser
- watir_browser = double('watir')
- watir_browser.should_receive(:is_a?).with(Watir::Browser).and_return(true)
- watir_browser
- end
-
+ let(:watir_browser) { mock_watir_browser }
+
it "should display the page text" do
- watir_browser = mock_watir_browser
watir_browser.should_receive(:text).and_return("browser text")
page_object = TestPageObject.new(watir_browser)
page_object.text.should == "browser text"
@@ -49,15 +44,9 @@ def mock_watir_browser
end
context "when using SeleniumPageObject" do
- def mock_selenium_browser
- selenium_browser = double('selenium')
- selenium_browser.should_receive(:is_a?).with(Watir::Browser).and_return(false)
- selenium_browser.should_receive(:is_a?).with(Selenium::WebDriver::Driver).and_return(true)
- selenium_browser
- end
-
+ let(:selenium_browser) { mock_selenium_browser }
+
it "should display the page text" do
- selenium_browser = mock_selenium_browser
selenium_browser.should_receive(:body_text).and_return("browser text")
page = TestPageObject.new(selenium_browser)
page.text.should == "browser text"
Please sign in to comment.
Something went wrong with that request. Please try again.