testingbot 0.1.7 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -2
  3. data/LICENSE +1 -1
  4. data/README.md +137 -0
  5. data/bin/testingbot +4 -3
  6. data/lib/testingbot.rb +1 -5
  7. data/lib/testingbot/api.rb +91 -15
  8. data/lib/testingbot/version.rb +1 -1
  9. data/spec/integration/api_spec.rb +21 -15
  10. data/spec/spec_helper.rb +6 -3
  11. data/testingbot.gemspec +3 -3
  12. metadata +7 -52
  13. data/README.rdoc +0 -237
  14. data/examples/android.rb +0 -14
  15. data/examples/capybara.rb +0 -22
  16. data/examples/capybara_multiple_browsers.rb +0 -38
  17. data/examples/cucumber/README.rdoc +0 -15
  18. data/examples/cucumber/Rakefile +0 -20
  19. data/examples/cucumber/features/support/env.rb +0 -13
  20. data/examples/cucumber/features/youtube.feature +0 -10
  21. data/examples/cucumber/features/youtube_steps.rb +0 -15
  22. data/examples/test_rspec.rb +0 -17
  23. data/examples/test_rspec1.rb +0 -36
  24. data/examples/test_unit.rb +0 -30
  25. data/lib/testingbot/capybara.rb +0 -66
  26. data/lib/testingbot/config.rb +0 -125
  27. data/lib/testingbot/cucumber.rb +0 -35
  28. data/lib/testingbot/hooks.rb +0 -284
  29. data/lib/testingbot/jasmine.rb +0 -29
  30. data/lib/testingbot/jasmine/README.rdoc +0 -16
  31. data/lib/testingbot/jasmine/Rakefile +0 -35
  32. data/lib/testingbot/jasmine/public/javascripts/Player.js +0 -22
  33. data/lib/testingbot/jasmine/public/javascripts/Song.js +0 -7
  34. data/lib/testingbot/jasmine/runner.rb +0 -4
  35. data/lib/testingbot/jasmine/spec/javascripts/PlayerSpec.js +0 -58
  36. data/lib/testingbot/jasmine/spec/javascripts/helpers/SpecHelper.js +0 -9
  37. data/lib/testingbot/jasmine/spec/javascripts/support/jasmine.yml +0 -73
  38. data/lib/testingbot/jasmine/test/Rakefile +0 -9
  39. data/lib/testingbot/jasmine/test/public/javascripts/Player.js +0 -22
  40. data/lib/testingbot/jasmine/test/public/javascripts/Song.js +0 -7
  41. data/lib/testingbot/jasmine/test/spec/javascripts/PlayerSpec.js +0 -58
  42. data/lib/testingbot/jasmine/test/spec/javascripts/helpers/SpecHelper.js +0 -9
  43. data/lib/testingbot/jasmine/test/spec/javascripts/support/jasmine.yml +0 -73
  44. data/lib/testingbot/selenium.rb +0 -127
  45. data/lib/testingbot/tunnel.rb +0 -104
  46. data/spec/integration/selenium1_spec.rb +0 -53
  47. data/spec/integration/selenium2_spec.rb +0 -60
  48. data/spec/integration/tunnel_spec.rb +0 -84
  49. data/spec/unit/api_spec.rb +0 -17
  50. data/spec/unit/config_spec.rb +0 -73
  51. data/spec/unit/tunnel_spec.rb +0 -41
  52. data/vendor/Testingbot-Tunnel.jar +0 -0
@@ -1,73 +0,0 @@
1
- require "rspec"
2
- require 'selenium/webdriver'
3
- require File.expand_path(File.dirname(__FILE__) + '/../../lib/testingbot/config.rb')
4
-
5
- describe TestingBot::Config do
6
- describe '#[]' do
7
- it "should return nil for options that don't exist" do
8
- c = TestingBot::Config.new
9
- c[:doesnotexist].should be_nil
10
- end
11
-
12
- it "should return a config value when being set from the constructor" do
13
- c = TestingBot::Config.new({ :client_secret => "secret!!" })
14
- c[:client_secret].should == "secret!!"
15
- end
16
- end
17
-
18
- describe '#[]=' do
19
- it "should successfully set a config value" do
20
- c = TestingBot::Config.new
21
- value = rand * 1000
22
- c[:client_key] = value
23
- c[:client_key].should == value
24
- end
25
- end
26
-
27
- describe "read config file" do
28
- it "should read values from the .testingbot config file" do
29
- if File.exists?(File.expand_path("~/.testingbot"))
30
- c = TestingBot::Config.new
31
- client_key, client_secret = File.open(File.expand_path("~/.testingbot")) { |f| f.readline }.chomp.split(":")
32
- c[:client_key].should == client_key
33
- end
34
- end
35
-
36
- it "should use the options I pass in the constructor, even if I have a config file" do
37
- if File.exists?(File.expand_path("~/.testingbot"))
38
- c = TestingBot::Config.new({ :client_key => "pickme" })
39
- client_key, client_secret = File.open(File.expand_path("~/.testingbot")) { |f| f.readline }.chomp.split(":")
40
- c[:client_key].should == "pickme"
41
- end
42
- end
43
- end
44
-
45
- describe "config values" do
46
- it "should specify a default desired capability if the user did not specify any" do
47
- c = TestingBot::Config.new
48
- c.desired_capabilities.should_not be_empty
49
- end
50
-
51
- it "should be possible to use a Selenium::WebDriver::Remote::Capabilities object for the desired capabilities" do
52
- c = TestingBot::Config.new
53
- c[:desired_capabilities] = Selenium::WebDriver::Remote::Capabilities.firefox
54
- c.desired_capabilities[:browserName].should eql("firefox")
55
- end
56
- end
57
-
58
- describe "usage" do
59
- it "should use the TestingBot.get_config as a singleton" do
60
- c = TestingBot.get_config
61
- c.should eql(TestingBot.get_config)
62
- end
63
-
64
- it "should be possible to reset the configuration" do
65
- c = TestingBot.get_config
66
- c.add_options({ :randomKey => "lol" })
67
-
68
- TestingBot.reset_config!
69
- c = TestingBot.get_config
70
- c[:randomKey].should be_nil
71
- end
72
- end
73
- end
@@ -1,41 +0,0 @@
1
- require "rspec"
2
- require File.expand_path(File.dirname(__FILE__) + '/../../lib/testingbot/config.rb')
3
- require File.expand_path(File.dirname(__FILE__) + '/../../lib/testingbot/tunnel.rb')
4
-
5
- describe TestingBot::Tunnel do
6
- describe "load config" do
7
- it "should load the configuration in the constructor" do
8
- tunnel = TestingBot::Tunnel.new
9
- tunnel.instance_variable_get("@config").should_not be_nil
10
- end
11
-
12
- it "should should not overwrite the config with arguments supplied in the constructor" do
13
- tunnel = TestingBot::Tunnel.new({ :client_key => "fake" })
14
- tunnel.instance_variable_get("@config")[:client_key].should_not eql("fake")
15
- end
16
-
17
- it "should allow for extra options to be specified, which will be passed to the jar's argument list" do
18
- tunnel = TestingBot::Tunnel.new({ :options => ["-f readyfile.txt", "-F *.com"] })
19
- tunnel.extra_options.should eql("-f readyfile.txt -F *.com")
20
- end
21
- end
22
-
23
- describe "before starting the tunnel" do
24
- it "should have 0 errors" do
25
- tunnel = TestingBot::Tunnel.new
26
- tunnel.errors.should be_empty
27
- end
28
-
29
- it "should not be connected" do
30
- tunnel = TestingBot::Tunnel.new
31
- tunnel.is_connected?.should == false
32
- end
33
- end
34
-
35
- describe "before stopping the tunnel" do
36
- it "should check if the tunnel has been started yet" do
37
- tunnel = TestingBot::Tunnel.new
38
- lambda { tunnel.stop }.should raise_error(RuntimeError, /^Can't stop tunnel/)
39
- end
40
- end
41
- end
Binary file