Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug when ActiveRecord is loaded together with Broach.
The JSON gem and ActiveRecord accept different arguments on the to_json method. This breaks when loading both and calling JSON.dump or JSON.generate but not the calling object.to_json for some reason.
- Loading branch information
Showing
4 changed files
with
41 additions
and
16 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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,19 @@ | |||
require File.expand_path('../../start', __FILE__) | |||
|
|||
require 'open3' | |||
require 'rbconfig' | |||
module InteractionSpecHelpers | |||
def ruby(script) | |||
ruby_bin = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']) | |||
stdin, stdout, stderr = Open3.popen3("#{ruby_bin} #{script}") | |||
stderr.read | |||
end | |||
end | |||
|
|||
describe "Broach, when ActiveSupport is loaded" do | |||
extend InteractionSpecHelpers | |||
|
|||
it "should say hi in a room" do | |||
ruby(File.expand_path('../scripts/say_hi.rb', __FILE__)).should == '' | |||
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
require 'rubygems' rescue nil | |||
require 'active_support' | |||
require 'rest' | |||
|
|||
$:.unshift File.expand_path('../../../../lib', __FILE__) | |||
require 'broach' | |||
|
|||
Broach.settings = YAML.load_file(File.expand_path('../../../../settings.yml', __FILE__)) | |||
Broach.speak(Broach.session.room, "Hi!") |