diff --git a/gems/active_polymorph/test.sh b/gems/active_polymorph/test.sh index 6a9f3875c79..5fc361d81a5 100755 --- a/gems/active_polymorph/test.sh +++ b/gems/active_polymorph/test.sh @@ -2,7 +2,6 @@ result=0 echo "################ active_polymorph ################" -echo "################ Running tests against Rails 3 ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? diff --git a/gems/activesupport-suspend_callbacks/test.sh b/gems/activesupport-suspend_callbacks/test.sh index b65b6bee22f..a41708e60bd 100755 --- a/gems/activesupport-suspend_callbacks/test.sh +++ b/gems/activesupport-suspend_callbacks/test.sh @@ -2,12 +2,9 @@ result=0 echo "################ activesupport-suspend_callbacks ################" -echo "################ Running tests against Rails 3 ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? -mv Gemfile.lock.rails2 Gemfile.lock - if [ $result -eq 0 ]; then echo "SUCCESS" diff --git a/gems/adheres_to_policy/test.sh b/gems/adheres_to_policy/test.sh index e2fc93242e1..251a5ccfda7 100755 --- a/gems/adheres_to_policy/test.sh +++ b/gems/adheres_to_policy/test.sh @@ -2,12 +2,9 @@ result=0 echo "################ adheres_to_policy ################" -echo "################ Running tests against Rails 3 ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? -mv Gemfile.lock.rails2 Gemfile.lock - if [ $result -eq 0 ]; then echo "SUCCESS" diff --git a/gems/bookmarked_collection/test.sh b/gems/bookmarked_collection/test.sh index 234adc9c587..59673330afb 100755 --- a/gems/bookmarked_collection/test.sh +++ b/gems/bookmarked_collection/test.sh @@ -2,12 +2,9 @@ result=0 echo "################ bookmarked_collection ################" -echo "################ Running tests against Rails 3 ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? -mv Gemfile.lock.rails2 Gemfile.lock - if [ $result -eq 0 ]; then echo "SUCCESS" diff --git a/gems/broadcast_policy/lib/broadcast_policy/notification_policy.rb b/gems/broadcast_policy/lib/broadcast_policy/notification_policy.rb index b76af6dbf29..a5cc2c64c98 100644 --- a/gems/broadcast_policy/lib/broadcast_policy/notification_policy.rb +++ b/gems/broadcast_policy/lib/broadcast_policy/notification_policy.rb @@ -40,12 +40,12 @@ module BroadcastPolicy notification = BroadcastPolicy.notification_finder.by_name(self.dispatch) return if notification.nil? - to_list = record.instance_eval &self.to - to_list = Array[to_list].flatten + to_list = record.instance_eval(&self.to) + to_list = Array(to_list).flatten return if to_list.empty? - asset_context = record.instance_eval &self.context if self.context - data = record.instance_eval &self.data if self.data + asset_context = record.instance_eval(&self.context) if self.context + data = record.instance_eval(&self.data) if self.data BroadcastPolicy.notifier.send_notification( record, diff --git a/gems/broadcast_policy/spec/broadcast_policy/notification_policy_spec.rb b/gems/broadcast_policy/spec/broadcast_policy/notification_policy_spec.rb index 69d46cff425..2f98149540a 100644 --- a/gems/broadcast_policy/spec/broadcast_policy/notification_policy_spec.rb +++ b/gems/broadcast_policy/spec/broadcast_policy/notification_policy_spec.rb @@ -30,29 +30,29 @@ describe BroadcastPolicy::NotificationPolicy do it "should not send if conditions are not met" do record = double('test object', skip_broadcasts: false) - subject.whenever = ->(r) { false } + subject.whenever = ->(_) { false } subject.broadcast(record) expect(BroadcastPolicy.notifier.messages).to be_empty end it "should not send if there is not a recipient list" do record = double('test object', skip_broadcasts: false) - subject.to = ->(r) { nil } + subject.to = ->(_) { nil } subject.broadcast(record) expect(BroadcastPolicy.notifier.messages).to be_empty end - it "should not send if there isn't a proper context" do + it "should send even if there isn't a context" do record = double('test object', skip_broadcasts: false) - subject.context = ->(r) { raise Error.new } + subject.context = ->(_) { nil } subject.broadcast(record) - expect(BroadcastPolicy.notifier.messages).to be_empty + expect(BroadcastPolicy.notifier.messages).to_not be_empty end - it "should not send if there isn't proper data" do + it "should send even if there isn't data" do record = double('test object', skip_broadcasts: false) - subject.data = ->(r) { raise Error.new } + subject.data = ->(_) { nil } subject.broadcast(record) - expect(BroadcastPolicy.notifier.messages).to be_empty + expect(BroadcastPolicy.notifier.messages).to_not be_empty end end diff --git a/gems/broadcast_policy/test.sh b/gems/broadcast_policy/test.sh new file mode 100755 index 00000000000..222a9d32300 --- /dev/null +++ b/gems/broadcast_policy/test.sh @@ -0,0 +1,15 @@ +#!/bin/bash +result=0 + +echo "################ broadcast_policy ################" +bundle check || bundle install +bundle exec rspec spec +let result=$result+$? + +if [ $result -eq 0 ]; then + echo "SUCCESS" +else + echo "FAILURE" +fi + +exit $result diff --git a/gems/canvas_ext/test.sh b/gems/canvas_ext/test.sh index 91faeed6632..040b1545f85 100755 --- a/gems/canvas_ext/test.sh +++ b/gems/canvas_ext/test.sh @@ -2,7 +2,6 @@ result=0 echo "################ canvas_ext ################" -echo "################ Running tests against Rails 3 ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? diff --git a/gems/canvas_quiz_statistics/Gemfile b/gems/canvas_quiz_statistics/Gemfile index 8fa8e9ba46a..7e79debc734 100644 --- a/gems/canvas_quiz_statistics/Gemfile +++ b/gems/canvas_quiz_statistics/Gemfile @@ -1,8 +1,12 @@ source 'https://rubygems.org' +gemspec + gem 'simplecov', '0.8.2', :require => false gem 'simplecov-rcov', '0.2.3', :require => false gem 'canvas_text_helper', :path => '../canvas_text_helper' gem 'html_text_helper', :path => '../html_text_helper' -gemspec +platforms :ruby_20, :ruby_21 do + gem 'iconv', '1.0.4' +end diff --git a/gems/canvas_quiz_statistics/test.sh b/gems/canvas_quiz_statistics/test.sh new file mode 100755 index 00000000000..fb9e07c0fe7 --- /dev/null +++ b/gems/canvas_quiz_statistics/test.sh @@ -0,0 +1,15 @@ +#!/bin/bash +result=0 + +echo "################ canvas_quiz_statistics ################" +bundle check || bundle install +bundle exec rspec spec +let result=$result+$? + +if [ $result -eq 0 ]; then + echo "SUCCESS" +else + echo "FAILURE" +fi + +exit $result diff --git a/gems/canvas_sanitize/test.sh b/gems/canvas_sanitize/test.sh new file mode 100755 index 00000000000..e650fddcf1f --- /dev/null +++ b/gems/canvas_sanitize/test.sh @@ -0,0 +1,15 @@ +#!/bin/bash +result=0 + +echo "################ canvas_sanitize ################" +bundle check || bundle install +bundle exec rspec spec +let result=$result+$? + +if [ $result -eq 0 ]; then + echo "SUCCESS" +else + echo "FAILURE" +fi + +exit $result diff --git a/gems/canvas_stringex/test.sh b/gems/canvas_stringex/test.sh index b4af4a17163..7da78b276e4 100755 --- a/gems/canvas_stringex/test.sh +++ b/gems/canvas_stringex/test.sh @@ -2,13 +2,10 @@ result=0 echo "################ canvas_stringex ################" -echo "################ Running tests against Rails 3 ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? bundle exec rake refresh_db -mv Gemfile.lock.rails2 Gemfile.lock - if [ $result -eq 0 ]; then echo "SUCCESS" diff --git a/gems/canvas_time/test.sh b/gems/canvas_time/test.sh index 610ea17f940..de91976a53a 100755 --- a/gems/canvas_time/test.sh +++ b/gems/canvas_time/test.sh @@ -1,12 +1,10 @@ #!/bin/bash result=0 -echo "################ Running tests against Rails 3 ################" +echo "################ canvas_time ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? -mv Gemfile.lock.rails2 Gemfile.lock - if [ $result -eq 0 ]; then echo "SUCCESS" diff --git a/gems/event_stream/test.sh b/gems/event_stream/test.sh index e0ee650f300..89480d89e82 100755 --- a/gems/event_stream/test.sh +++ b/gems/event_stream/test.sh @@ -1,7 +1,7 @@ #!/bin/bash result=0 -echo "################ Running tests against Rails 3 ################" +echo "################ event_stream ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? diff --git a/gems/html_text_helper/test.sh b/gems/html_text_helper/test.sh index 1ff0477c09c..1bae29f6e8e 100755 --- a/gems/html_text_helper/test.sh +++ b/gems/html_text_helper/test.sh @@ -2,7 +2,6 @@ result=0 echo "################ html_text_helper ################" -echo "################ Running tests against Rails 3 ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? diff --git a/gems/i18n_extraction/test.sh b/gems/i18n_extraction/test.sh index ec8e6eedb57..5383127ed9a 100755 --- a/gems/i18n_extraction/test.sh +++ b/gems/i18n_extraction/test.sh @@ -2,12 +2,9 @@ result=0 echo "################ i18n_extraction ################" -echo "################ Running tests against Rails 3 ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? -mv Gemfile.lock.rails2 Gemfile.lock - if [ $result -eq 0 ]; then echo "SUCCESS" diff --git a/gems/i18n_tasks/test.sh b/gems/i18n_tasks/test.sh index 238b605ccf9..da262d79ccd 100755 --- a/gems/i18n_tasks/test.sh +++ b/gems/i18n_tasks/test.sh @@ -2,12 +2,9 @@ result=0 echo "################ i18n_tasks ################" -echo "################ Running tests against Rails 3 ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? -mv Gemfile.lock.rails2 Gemfile.lock - if [ $result -eq 0 ]; then echo "SUCCESS" diff --git a/gems/incoming_mail_processor/test.sh b/gems/incoming_mail_processor/test.sh index e1c79ad28e5..e254e09da20 100755 --- a/gems/incoming_mail_processor/test.sh +++ b/gems/incoming_mail_processor/test.sh @@ -2,11 +2,9 @@ result=0 echo "################ incoming_mail_processor ################" -echo "################ Running tests against Rails 3 ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? -mv Gemfile.lock.rails2 Gemfile.lock if [ $result -eq 0 ]; then echo "SUCCESS" diff --git a/gems/paginated_collection/test.sh b/gems/paginated_collection/test.sh index dfa607c4c40..1ac11d223b5 100755 --- a/gems/paginated_collection/test.sh +++ b/gems/paginated_collection/test.sh @@ -2,12 +2,9 @@ result=0 echo "################ paginated_collection ################" -echo "################ Running tests against Rails 3 ################" bundle check || bundle install bundle exec rspec spec let result=$result+$? -mv Gemfile.lock.rails2 Gemfile.lock - if [ $result -eq 0 ]; then echo "SUCCESS"