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
File.write(‘sample_file.txt’, reversed_string) |
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
describe Game do | |
it 'should let players to be created' do | |
game = Game.new | |
game.start | |
player = game.createPlayer('Player 1') | |
expect(player).to_not be_nil | |
game.stop | |
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
require ‘selenium-webdriver’ | |
driver = Selenium::WebDriver.for :firefox | |
driver.navigate.to "http://string_util_test.com" | |
input_element = driver.find_element(:name, 'given_string') | |
input_element.send_keys "Functional Test" | |
reverse_button = driver.find_element(:id, "reverse") | |
reverse_button.click |
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
class StringUtil | |
def reverse a_string | |
a_string.reverse | |
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
class Pmadurai | |
include Scrapify::Base | |
html "http://www.projectmadurai.org/pmworks.tscii.html" | |
attribute :name, xpath: "//table[@id = 'sortabletable']/tbody/tr/td[2]" | |
attribute :author, xpath: "//table[@id = 'sortabletable']/tbody/tr/td[3]" | |
attribute :urls, xpath: "//table[@id = 'sortabletable']/tbody/tr/td[7]" do |element| | |
element.children.map do |child| | |
child.xpath('@href').map(&:value) | |
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
class Soap | |
extend Savon::Model | |
document "http://www.webservicex.net/CurrencyConvertor.asmx?WSDL" | |
def thread_safe? | |
p run_in_threads [:inr_to_usd, :usd_to_inr] | |
sleep 5 | |
p run_in_threads [:usd_to_inr, :inr_to_usd] | |
end |