Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 05 2019 05:12

    zeisler on master

    v2.6.2 (compare)

  • Sep 05 2019 05:09

    zeisler on master

    Correct Ruby and Rails versions (compare)

  • Sep 05 2019 05:07

    zeisler on rails-6

    (compare)

  • Sep 05 2019 05:07

    zeisler on master

    Testing for rails 6 (#124) * T… (compare)

  • Sep 05 2019 05:07
    zeisler closed #124
  • Sep 05 2019 05:02
    zeisler closed #123
  • Sep 05 2019 05:00
    zeisler synchronize #124
  • Sep 05 2019 05:00

    zeisler on rails-6

    Don't run ruby 2.4 with Rails 5 (compare)

  • Sep 05 2019 04:58
    zeisler synchronize #124
  • Sep 05 2019 04:58

    zeisler on rails-6

    Adjust Rails 5.0 code to apply … (compare)

  • Jul 30 2019 15:12
    zeisler commented #123
  • Jul 30 2019 05:34
    mahigawas28 commented #123
  • Jul 29 2019 22:04
    zeisler synchronize #119
  • Jul 29 2019 22:04

    zeisler on include_modules

    Add forwardable to loaded_mocks… Merge branch 'master' into incl… (compare)

  • Jul 29 2019 21:32
    zeisler commented #123
  • Jul 26 2019 18:24
    zeisler commented #123
  • Jul 26 2019 18:23
    zeisler commented #123
  • Jul 25 2019 04:40
    mahigawas28 commented #123
  • Jul 24 2019 22:50
    zeisler synchronize #124
  • Jul 24 2019 22:50

    zeisler on rails-6

    fix syntax error (compare)

thermaldonkey
@thermaldonkey
ActiveMocker v1.6.3
Dustin Zeisler
@zeisler
@thermaldonkey try 'rails c' then 'ActiveMocker.create_mocks
Dustin Zeisler
@zeisler
I am testing with the same ruby and rails version. To see if it is a configuration issue can you create new rails app and try it? @thermaldonkey
thermaldonkey
@thermaldonkey
@zeisler That was a good move on the Rails console suggestion. I got a NameError: uninitialized constant ActiveMocker exception. So I double-checked my Gemfile. I had active_mocker included under the test environment, and not the development environment. Makes sense why dev wasn't understanding. Fixing that and running bundle fixed both errors, and I'm ready to test! Thanks!
Dustin Zeisler
@zeisler
@thermaldonkey your welcome glad I could get you going. If you have any more questions feel free to ask.
Jay R Bolton
@jayrbolton
Any tricks to get the gem to work with rails 3.2? looks like versions after 0.4.0 require activesupport 4.0 and I can't get 0.4.0 to work much
(really want to use this gem)
Dustin Zeisler
@zeisler
@jayrbolton I'm sorry your having trouble. Sadly I have never used AM gem with rails 3 and believe the AR api might be a bit different, but with that said it's possible to work. I know this fork tried: https://github.com/hjhart/active_mocker I can not support this fork and don't know if it ever worked. Going back versions would not solve the problem because it was an unspecified rails 4 dependency.
@jayrbolton Sorry if that wasn't very helpful, but if there is anything else I can help you with let me know.
Jay R Bolton
@jayrbolton
hi @zeisler, thanks for the response, and sorry for this really really delayed reply. We are going to upgrade to rails 4 at some point in the future, but in the mean time I refactored all our business logic to be functions that operate over hashes, so the tests are faster now. however, we still have a lot of other model tests that i'm hoping to use active_mocker for in the near future after we upgrade...
Dustin Zeisler
@zeisler
@jayrbolton my schema reader project is not supported any more but it may work for rails 3. https://github.com/zeisler/schema_reader
Jay R Bolton
@jayrbolton
cool, will give that a go
Bahador Biglari
@bbiglari
I am trying to use active_mocker in my sinatra app with Jruby 9.0.4
rake active_mocker:build will generate the following error Don't know how to build task 'active_mocker:build' (see --tasks)
also rake -T doesn't show the rake task I am running
any idea?
so my thoughts: since active_mocker works with active_record, it shouldn't be ruby dependent
but it may be the case
Dustin Zeisler
@zeisler
I have never tested AM with jruby, you are the first I've heard of.
I think it would be great if it would.
Although I have no idea what is needed to make that happen. I know any 'C' dependencies would have to be switched out.
I am open to giving my guidance and support for making it work with jruby, but my time is limited keeping up with new feature.
@bbiglari ^
This is the code that the rake task runs, you can try and run that manually without the rack task. https://github.com/zeisler/active_mocker/blob/master/lib/active_mocker/task.rake
Bahador Biglari
@bbiglari
@Zeisler thanks for your quick response, I will try to get this to work. I will update you soon.
THanks
Bahador Biglari
@bbiglari
@zeisler, I created the following rake task

require 'active_record'

Dir[File.dirname(FILE) + "/../lib/api.rb"].each { |file| require file }
Dir[File.dirname(FILE) + "/../models/*.rb"].each { |file| require file }

namespace :active_mocker do

desc('build mocks')
task :build do
task(:environment) do
end
ActiveMocker.configure do |c|
c.single_model_path = ENV['MODEL'] if ENV['MODEL']
c.model_dir = ENV['MODEL_DIR'] if ENV['MODEL_DIR']
c.mock_dir = ENV['MOCK_DIR'] if ENV['MOCK_DIR']
c.progress_bar = false if ENV['MUTE_PROGRESS_BAR']
c.error_verbosity = ENV['ERROR_VERBOSITY'].to_i if ENV['ERROR_VERBOSITY']
c.disable_modules_and_constants = false
end.create_mocks
end
end

This is the error
NameError: uninitialized constant ActiveMocker
/tasks/active_mocker.rake:12:in `block in (root)'
it cannot find the gem file I guess
any idea?
Dustin Zeisler
@zeisler
In your Gemfile is AM included in the development environment?
Bahador Biglari
@bbiglari
Yes, I even wen further and copy the files in my local directory
but I still have some other issue
I will update you
Dustin Zeisler
@zeisler
From little I know about jruby the issues you are having do not seem like jruby specific issue.
Matt Spendlove
@msp
HI @zeisler - nice work with the Gem
looks promising for me
I'm having an issue however where a mock is being loading in a spec where I'm not expecting
Failure/Error: u.monthly_invoices << aug_monthly_invoice
ActiveRecord::AssociationTypeMismatch:
MonthlyInvoice(#70309256338400) expected, got MonthlyInvoiceMock(#70309296729520)
Did i mess up some config?
Matt Spendlove
@msp
to be clear, this spec has no tag 'active_mocker: true', but I have one other spec that does which I assumed cleared up after itself, according to the docs?
Matt Spendlove
@msp
FYI - I fixed this by not using FactoryGirl.create directly in the non active_mocker tests and using this kinda pattern instead: atts = FactoryGirl.attributes_for(:monthly_invoice), MonthlyInvoice.create(atts). Seems to be a bug in the the combination of FG & AM to me
Rajasheker--g
@Rajasheker--g
Hi All,
I am working with rake tasks
is there any way to integrate the rake tasks with acitve_mocker
if yes, could you please provide me any link or give me the steps to integrate pleasee
Dustin Zeisler
@zeisler
@Rajasheker--g check out https://github.com/zeisler/active_mocker/blob/master/lib/active_mocker/task.rake for the default rake tasks and let me know what else you are looking for.