This file contains hidden or 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
A few examples will help to clarify these operations. Let's begin by creating two arrays: | |
operating_systems = ["Fedora", "SuSE", "RHEL", "Windows", "MacOS"] | |
linux_systems = ["RHEL", "SuSE", "PCLinuxOS", "Ubuntu", "Fedora"] | |
Now, we can create a union of the two arrays: | |
operating_systems | linux_systems | |
=> ["Fedora", "SuSE", "RHEL", "Windows", "MacOS", "PCLinuxOS", "Ubuntu"] |
This file contains hidden or 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
Failure/Error: document.nokogiri_document.should be_a_kind_of(Nokogiri) | |
expected #<Nokogiri::HTML::Document:0x8041d478 name="document" children=[#<Nokogiri::XML::DTD:0x80a01a24 name="html">, #<Nokogiri::XML::Element:0x80b02a2c name="html">]> to be a kind of Nokogiri |
This file contains hidden or 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 "#create_nokogiri_object" do | |
it "if supplied document is not a nokogiri object" do | |
document = DeschutesDocument.new('<html>') | |
document.nokogiri_document.should be_a_kind_of(Nokogiri) | |
end | |
end |
This file contains hidden or 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
def save_deed_and_related_documents(deed) | |
unless deed.make_reference.nil? | |
deed.make_reference.each do | reference | | |
puts reference | |
end | |
end | |
end |
This file contains hidden or 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
def save_deed_and_related_documents(deed) | |
unless deed.make_reference.nil? | |
deed.make_reference.each do | reference | | |
deed.each do | record | | |
puts record | |
end | |
end | |
end | |
end |
This file contains hidden or 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
def save_deed_and_related_documents(deed) | |
unless deed.make_reference.nil? | |
deed.make_reference.each do | reference | | |
reference.each do | record | | |
puts record | |
end | |
end | |
end | |
end |
This file contains hidden or 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
// helpers | |
function areEnemies(robot, sighted) { | |
var sightedIsChild = (robot.id == sighted.parentId); | |
var sightedIsParent = (robot.parentId == sighted.id); | |
return !(sightedIsChild || sightedIsParent); | |
}; | |
function baseStep(robot) { |
This file contains hidden or 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
Traceback (most recent call last): | |
File "/home/elvis/emscripten/emcc", line 1272, in <module> | |
flush_js_optimizer_queue() | |
File "/home/elvis/emscripten/emcc", line 1222, in flush_js_optimizer_queue | |
final = shared.Building.js_optimizer(final, js_optimizer_queue, jcache) | |
File "/home/elvis/emscripten/tools/shared.py", line 1057, in js_optimizer | |
return js_optimizer.run(filename, passes, NODE_JS, jcache) | |
File "/home/elvis/emscripten/tools/js_optimizer.py", line 179, in run | |
return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, jcache)) | |
File "/home/elvis/emscripten/tools/shared.py", line 435, in run_and_clean |
This file contains hidden or 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
func ShowCris(fname string, lname string) (string, error) { | |
res, err := DoSomethingAmazing(fname,lname) | |
if err != nil { | |
Panic(err) | |
} | |
return res, nil | |
} |
This file contains hidden or 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
// Because TestMain() is an init method and should (in most cases) only be called once, one must wrap it to extend the functionality | |
// | |
// 1. This code should exist in a setup_test.go (descriptive name) file | |
// 2. Setup/Teardown methods along with variables/connections/assets for specific tests should be written inside of the specific test file | |
// Example Filename: some_random_test.go | |
// Setup Method: someRandomTestSetup() | |
// Teardown Method: someRandomTestTeardown() | |
// 3. The Setup/Teardown methods are added to the global testMainSetup()/testMainTeardown() to centralize and organize your test suite | |
package proj |
OlderNewer